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

Explain what is dynamic data structure?

651


explain what is an endless loop?

615


Can the sizeof operator be used to tell the size of an array passed to a function?

622


What is a const pointer?

640


Wt are the Buses in C Language

2754






write a program in C that prompts the user for today's date,tomorrow's date and display the results.Use structures for today's date,tomorrow's date and an array to hold the days for each month of the year.

4992


What is calloc malloc realloc in c?

598


How will you declare an array of three function pointers where each function receives two ints and returns a float?

787


What is abstract data structure in c?

533


How was c created?

591


In which header file is the null macro defined?

861


What are the different types of objects used in c?

581


"C" language developed by "Dennis Ritchie" at AT & T. his remarks are a) too general, too abstract b) could deal with only specific problems c) lost generality of BCPL and B restored d) no remarks

662


hi to every one .. how to view table pool after creating the pooled table? plz help me.. if any knows abt this ..

1471


#include { printf("Hello"); } how compile time affects when we add additional header file .

1429