write a c program to print a given number as odd or even
without using loop statements,(no if ,while etc)
Answer Posted / avinash kumar
#include<stdio.h>
main()
{
int a;
clrscr();
printf("enter a number:");
scanf("%d",&a);
if(a%2=0)
printf("even");
else
printf("odd")
getch();
}
| Is This Answer Correct ? | 25 Yes | 22 No |
Post New Answer View All Answers
How can you increase the size of a dynamically allocated array?
What should malloc() do?
What is a rvalue?
How many header files are in c?
Write a code to determine the total number of stops an elevator would take to serve N number of people.
Explain what is the difference between #include and #include 'file' ?
What is the use of define in c?
What is function prototype in c with example?
Which header file is essential for using strcmp function?
Why is c called a structured programming language?
What is cohesion in c?
What is unsigned int in c?
‘SAVEPOINT’ and ‘ROLLBACK’ is used in oracle database to secure the data comment. Give suitable examples of each with sql command.
Differentiate between Macro and ordinary definition.
Explain about the functions strcat() and strcmp()?