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...

To find whether a number is even or odd without using any
conditional operator??

Answer Posted / kala

main()
{
int n;
printf("enter the number\n");
scanf("%d",&n);
if(n%2==0){
printf("number is even");}
else{
printf("number is odd");
}
}
or
if(n&1==0)
printf("even number");
else
printf(odd number");

Is This Answer Correct ?    31 Yes 38 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain what is the purpose of "extern" keyword in a function declaration?

1071


What is zero based addressing?

1169


What does %c do in c?

987


int main() { Int n=20,i; For(i=0;i<=n;i--) { Printf(“-“); Return 0;

1820


Which is not valid in C a) class aClass{public:int x;}; b) /* A comment */ c) char x=12;

1071


What is the difference between int main and void main?

1045


Why is c called a structured programming language?

1274


How are strings stored in c?

1014


Write a program for Overriding.

1157


What do you mean by c what are the main characteristics of c language?

1031


PLS U SENS ME INTERVIEW O. MY EMAIL ADD, SOFIYA.SINGH@GMAIL.COM

2182


which is conditional construct a) if statement b) switch statement c) while/for d) goto

1217


1.int a=10; 2.int b=20; 3. //write here 4.b=30; Write code at line 3 so that when the value of b is changed variable a should automatically change with same value as b. 5.

2148


What is openmp in c?

1022


main(){char *str;scanf("%s",str);printf("%s",str); }The error in the above program is: a) Variable 'str' is not initialised b) Format control for a string is not %s c) Parameter to scanf is passed by value. It should be an address d) none

1358