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 / ligory antony

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

Is This Answer Correct ?    6 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a pointer and how it is initialized?

1109


What is the advantage of a random access file?

1150


Why is void main used?

1048


Why #include is used in c language?

1013


What is the basic structure of c?

1033


What are dangling pointers in c?

1153


What is the difference between malloc() and calloc() function in c language?

1044


How many levels of pointers can you have?

1148


What are the types of data types and explain?

1049


What are the modifiers available in c programming language?

1186


What does nil mean in c?

1200


What is array of pointers to string?

1019


what is uses of .net

1697


Explain what does the function toupper() do?

1023


Which one to choose from 'initialization lists' or 'assignment', for the use in the constructor?

1047