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
writ a program to compare using strcmp VIVA and viva with its output.
What are header files? What are their uses?
In C programming, what command or code can be used to determine if a number of odd or even?
Are enumerations really portable?
Can a pointer be null?
Draw a diagram showing how the operating system relates to users, application programs, and the computer hardware ?
What does c value mean?
What is #include cctype?
What is the difference between scanf and fscanf?
Explain the meaning of keyword 'extern' in a function declaration.
What the advantages of using Unions?
Explain what is the difference between a string copy (strcpy) and a memory copy (memcpy)? When should each be used?
What is a char in c?
What is identifiers in c with examples?
What are the different types of objects used in c?