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

Explain what is the difference between a string and an array?

1120


What do you mean by dynamic memory allocation in c? What functions are used?

1126


Can a variable be both static and volatile in c?

988


Tell us two differences between new () and malloc ()?

1132


Write a program of prime number using recursion.

1046


What are the salient features of c languages?

1065


Write a program to reverse a string.

1041


What is meant by recursion?

1012


What is the ANSI C Standard?

1229


How many loops are there in c?

1065


If you know then define #pragma?

1060


Apart from dennis ritchie who the other person who contributed in design of c language.

1340


explain what is a newline escape sequence?

1049


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

1022


What is dynamic dispatch in c++?

1020