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 / rohit agarwal

#include<stdio.h>
#include<conio.h>
main()
{
int n;
char *p[]={"Even","odd"};
clrscr();
printf("Enter the number");
scanf("%d",&n);
n=n%2;
printf("The value is %s",p[n]);
getch();

Is This Answer Correct ?    1 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can I get the current date or time of day in a c program?

1185


How will you declare an array of three function pointers where each function receives two ints and returns a float?

1314


How can I determine whether a machines byte order is big-endian or little-endian?

1020


What is printf () in c?

1028


Is fortran faster than c?

1007


What is atoi and atof in c?

1046


Explain how can a program be made to print the name of a source file where an error occurs?

1158


Suggesting that there can be 62 seconds in a minute?

1009


What is p in text message?

949


What is difference between scanf and gets?

1190


#include { printf("Hello"); } how compile time affects when we add additional header file .

1866


Explain what is the difference between null and nul?

1100


Should I use symbolic names like true and false for boolean constants, or plain 1 and 0?

1032


What is the difference between array and structure in c?

1107


Why do we use & in c?

958