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

find a number whether it is even or odd without using any
control structures and relational operators?

Answer Posted / sanju uthaiah

#include<stdio.h>

int main()
{
char result[2]={"Even","Odd"};
int n=40;
printf("%d is %s",n,result[n%2]);
return 0;
}

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why is it usually a bad idea to use gets()? Suggest a workaround.

1779


If a variable is a pointer to a structure, then which operator is used to access data members of the structure through the pointer variable?

1254


Give a one-line C expression to test whether a number is a power of 2. [No loops allowed - it's a simple test.]

1078


Write a simple code fragment that will check if a number is positive or negative.

1145


What is 02d in c?

1071


hw can we delete an internal node of binary search tree the internal node has child node..plz write progarm

2019


What is volatile c?

1020


What is d scanf?

1083


can any one provide me the notes of data structure for ignou cs-62 paper

2171


How do you declare a variable that will hold string values?

1172


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

1071


What is the method to save data in stack data structure type?

1083


Calculate 1*2*3*____*n using recursive function??

2034


A text file that contains declarations used by a group of functions,programs,or users a) executable file b) header file c) obj file d) .cfile

1091


What is NULL pointer?

1089