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 functions are used in dynamic memory allocation in c?

1119


What do you mean by recursion in c?

1166


What is the scope of local variable in c?

1200


When reallocating memory if any other pointers point into the same piece of memory do you have to readjust these other pointers or do they get readjusted automatically?

1328


What is meant by type casting?

1106


Explain what is dynamic data structure?

1221


How many loops are there in c?

1163


Explain how can I remove the trailing spaces from a string?

1104


Is it possible to have a function as a parameter in another function?

1129


Do pointers take up memory?

1207


Explain pointers in c programming?

1159


Why use int main instead of void main?

1178


write a c program in such a way that if we enter the today date the output should be next day's date.

2240


Explain goto?

1205


What does a pointer variable always consist of?

1157