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

A c program to display count values from 0 to 100 and flash each digit for a secong.reset the counter after it reaches 100.use for loop,. pls guys hepl me.. :(

2217


develop algorithms to add polynomials (i) in one variable

2127


What is the condition that is applied with ?: Operator?

1095


Why can't I perform arithmetic on a void* pointer?

1065


What is wrong with this declaration?

1071


Differentiate between null and void pointers.

1134


Can I initialize unions?

1006


Explain what is wrong with this statement? Myname = ?robin?;

1543


What is clrscr in c?

1097


what is the difference between 123 and 0123 in c?

1169


What does #pragma once mean?

1123


What is clrscr ()?

1070


I need a sort of an approximate strcmp routine?

998


Explain the meaning of keyword 'extern' in a function declaration.

1132


What is a sequential access file?

1124