find a number whether it is even or odd without using any
control structures and relational operators?
Answer Posted / abhradeep chatterjee
ya. the first answer has impressed me.
#include<stdio.h>
main()
{
int n;
string p[2]={"Even","odd"};
Printf("Enter the number");
scanf("%d",&n);
n=n%2;
printf("The value is %s",p[n]);
}
| Is This Answer Correct ? | 5 Yes | 1 No |
Post New Answer View All Answers
Can static variables be declared in a header file?
What is anagram in c?
How can I sort a linked list?
Compare and contrast compilers from interpreters.
What are qualifiers in c?
How can I call system when parameters (filenames, etc.) Of the executed command arent known until run time?
How would you use the functions fseek(), freed(), fwrite() and ftell()?
What is operator promotion?
write a C program: To search a file any word which starts with ?a?. If the word following this ?a? starts with a vowel.Then replace this ?a? with ?a? with ?an?. redirect with the output onto an output file.The source file and destination file are specified by the user int the command line.
Is r written in c?
What is cohesion and coupling in c?
What is the use of bit field?
Is javascript written in c?
What does %c do in c?
What does sizeof return c?