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

How to find the given no is odd or even without checking of
any condition and loops. (Hint: Using array)

Answer Posted / vaishu

void main()
{
int n;
char s[]={"even","odd"};
printf("Enter the no.:");
scanf("%d",&n);
n=n%2;
printf("th no. is %s",s[n]);
getch();
}

Is This Answer Correct ?    12 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

program to convert a integer to string in c language'

2452


how to print electricity bill according to following charges first 100 units -1rs per unit for next 200 units-1.50 rs per unit without using conditions

3173


Why #include is used in c language?

1046


What is the difference between union and structure in c?

1169


What is the data segment that is followed by c?

1081


When would you use a pointer to a function?

1042


how many key words availabel in c a) 28 b) 31 c) 32

1076


Is c procedural or object oriented?

1000


What are logical errors and how does it differ from syntax errors?

1293


What does printf does?

1240


What is sizeof int?

1093


What is the sizeof () operator?

1079


Why are some ANSI/ISO Standard library routines showing up as undefined, even though I've got an ANSI compiler?

1125


What does typeof return in c?

1090


What is the difference between new and malloc functions?

1120