Write a program to find given number is even or odd without
using any control statement.
Answer Posted / rani
#include<stdio.h>
#include<conio.h>
void main()
{
char str[][10]={"even","odd"};
int no;
clrscr();
printf("\nEnter a number...");
scanf("%d",&no);
printf("\n%d is %s",no,str[no%2]);
getch();
}
| Is This Answer Correct ? | 13 Yes | 1 No |
Post New Answer View All Answers
How do you determine the length of a string value that was stored in a variable?
How can this be legal c?
What are header files and what are its uses in C programming?
What is a class c rental property?
what are non standard function in c
What are type modifiers in c?
main() { inta=10,b=20; a>=5?b=100:b=200; printf("%d ",b); }
what will be maximum number of comparisons when number of elements are given?
Is register a keyword in c?
How can I call system when parameters (filenames, etc.) Of the executed command arent known until run time?
What is the difference between union and anonymous union?
Explain what does the format %10.2 mean when included in a printf statement?
What does volatile do?
#include main() { char s[] = "Bouquets and Brickbats"; printf(" %c, ",*(&s[2])); printf("%s, ",s+5); printf(" %s",s); printf(" %c",*(s+2)); }
What is the function of this pointer?