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
Define macros.
how can i access hard disk address(physical address)? are we access hard disk by using far,near or huge pointer? if yes then please explain.....
Can the “if” function be used in comparing strings?
What is the purpose of macro in C language?
Write a program to generate a pulse width frequency of your choise,which can be variable by using the digital port of your processor
How many types of arrays are there in c?
What is the role of this pointer?
What is a shell structure examples?
How to compare array with pointer in c?
What is preprocessor with example?
code for replace tabs with equivalent number of blanks
Write a progarm to find the length of string using switch case?
What does a derived class inherit from a base class a) Only the Public members of the base class b) Only the Protected members of the base class c) Both the Public and the Protected members of the base class d) .c file
How to get string length of given string in c?
Why is C language being considered a middle level language?