How to find the given no is odd or even without checking of
any condition and loops. (Hint: Using array)
Answer Posted / anandi
void main()
{
int n;
char s[20][20]={"even","odd"};
printf("Enter the no.:");
scanf("%d",&n);
n=n%2;
printf("th no. is %s",s[n]);
getch();
}
| Is This Answer Correct ? | 3 Yes | 3 No |
Post New Answer View All Answers
What is the meaning of 2d in c?
What is the translation phases used in c language?
What are the advantages of c language?
Create a structure to specify data on students as given below: Roll number, Name, Department, Course, and Year of joining. Assume that there are not more than 450 students in the collage. (a) Write a function to print the names of all students who joined in the last 3 years. (b) Write a function to print the data of a student whose roll numbers are divisible by 4.
What is the size of empty structure in c?
What are the data types present in c?
Explain the difference between ++u and u++?
The number of measuring units from an arbitarary starting point in a record,area,or control block to some other point a) recording pointer b) offset c) branching d) none
What does the c in ctime mean?
How will you write a code for accessing the length of an array without assigning it to another variable?
What is an endless loop?
What is the significance of scope resolution operator?
In c language can we compile a program without main() function?
find the sum of two matrices and WAP for it.
Write a program to generate random numbers in c?