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
What is gets() function?
Can we initialize extern variable in c?
Explain how can I right-justify a string?
to find the closest pair
Why malloc is faster than calloc?
How can you increase the allowable number of simultaneously open files?
What is pragma in c?
write a program to concatenation the string using switch case?
Write a function stroverlap that takes (at least) two strings, and concatenates them, but does not duplicate any overlap. You only need to worry about overlaps between the end of the first string and the beginning of the second string. Examples: batman, manonthemoon = batmanonthemoon batmmamaman, mamamanonthemoon = batmmamamanonthemoon bat, man = batman batman, batman = batman batman, menonthemoon = batmanmenonthemoon
Why enum is used in c?
What is the use of gets and puts?
Is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?
How to get string length of given string in c?
Why is structure padding done in c?
Explain how do you declare an array that will hold more than 64kb of data?