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
Is c still relevant?
What is volatile variable in c with example?
what will be maximum number of comparisons when number of elements are given?
Write a factorial program using C.
What is difference between %d and %i in c?
How can I pad a string to a known length?
What are header files in c?
What are called c variables?
How many keywords (reserve words) are in c?
What is difference between array and structure in c?
Explain do array subscripts always start with zero?
What is p in text message?
Can a void pointer point to a function?
What is the difference between fread and fwrite function?
write a program in C that prompts the user for today's date,tomorrow's date and display the results.Use structures for today's date,tomorrow's date and an array to hold the days for each month of the year.