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 / ramesh

#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 ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What does *p++ do?

973


Why is c platform dependent?

1019


I heard that you have to include stdio.h before calling printf. Why?

1006


What is mean by Data Driven framework in QTP? Can any one answer me in details on this regard.

2200


How macro execution is faster than function ?

1130


Explain indirection?

1057


Why do we need functions in c?

952


What is the maximum length of an identifier?

1128


can we have joblib in a proc ?

2226


How will you print TATA alone from TATA POWER using string copy and concate commands in C?

1324


What is the use of putchar function?

1005


Describe explain how arrays can be passed to a user defined function

1037


What does the format %10.2 mean when included in a printf statement?

1584


Is a pointer a kind of array?

1111


What does %c mean in c?

1026