Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

what is the other ways to find a logic to print whether a
number is an even or odd wit out using % symbol??????? i
know three different ways to print it. so i need any other
different logic>>>>>

Answer Posted / tirtharaj dash@nist

#include<stdio.h>
#include<conio.h>

int main()
{
int a,b,r,i;
scanf("%d",&b);
int temp=b;
for(i=1;i<=b/2;i++)
{
r=temp-2*i;
}
if(r==0)
printf("\neven...");
else
printf("\nodd");

getch();
return 0;
}

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is the height of tree if leaf node is at level 3. please explain

2204


What is #ifdef ? What is its application?

1168


Explain the properties of union. What is the size of a union variable

1249


Is boolean a datatype in c?

1135


Write a program to compute the similarity between two strings - The program should get the two strings as input - Then it will output one single number which is the percentage of similarity between the two strings

2810


Can you write the function prototype, definition and mention the other requirements.

1202


Which node is more powerful and can handle local information processing or graphics processing?

1375


Explain what is the advantage of a random access file?

1181


Why doesnt long int work?

1101


What is the difference between text and binary i/o?

1122


How can you check to see whether a symbol is defined?

1141


The difference between printf and fprintf is ?

1346


What is default value of global variable in c?

1055


Write a code to achieve inter processor communication (mutual exclusion implementation pseudo code)?

1171


What is page thrashing?

1148