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
Why void is used in c?
How do you initialize pointer variables?
Are c and c++ the same?
What are conditional operators in C?
Hai sir, I had planned to write the NIC scientific engineer exam , plz post the sample question......
What are loops c?
Should I learn data structures in c or python?
What is the advantage of c?
What is static and volatile in c?
Is printf a keyword?
By using C language input a date into it and if it is right?
What does %p mean c?
What are the 5 data types?
What does volatile do?
How does pointer work in c?