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

How can I remove the leading spaces from a string?

1097


What are the string functions? List some string functions available in c.

949


If a five digit number is input through the keyboard, write a program to print a new number by adding one to each of its digits.For example if the number that is input is 12391 then the output should be displayed as 23402

3848


What is meant by gets in c?

1103


How do you list files in a directory?

1076


What does c value mean?

1115


How are 16- and 32-bit numbers stored?

1238


What is assignment operator?

1000


How can I split up a string into whitespace-separated fields?

1005


Explain how can a program be made to print the line number where an error occurs?

1148


how to execute a program using if else condition and the output should enter number and the number is odd only...

2207


What is calloc in c?

1080


What are the difference between a free-standing and a hosted environment?

1220


Why we use conio h in c?

1155


What is static volatile in c?

976