write a c program to print a given number as odd or even
without using loop statements,(no if ,while etc)
Answer Posted / manojkumar
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b;
clrscr();
printf("enter the number :");
scanf("%d",&a);
b=a%2;
switch(b)
{
case 1:
printf("The number %d is even",no);
break;
case 2:
printf("The number %d is odd",no);
break;
}
getch();
}
| Is This Answer Correct ? | 3 Yes | 4 No |
Post New Answer View All Answers
what do u mean by Direct access files? then can u explain about Direct Access Files?
Why is extern used in c?
Why is it usually a bad idea to use gets()? Suggest a workaround.
What is time null in c?
Write program to remove duplicate in an array?
What is 'bus error'?
find the value of y y = 1.5x+3 for x<=2 y = 2x+5 for x>2
Which is better malloc or calloc?
Write a C program to accept a matrix of any size. Find the frequency count of each element in the matrix and positions in which they appear in the matrix
What are the advantages of using macro in c language?
What is the purpose of & in scanf?
Is it possible to use curly brackets ({}) to enclose single line code in c program?
In a switch statement, explain what will happen if a break statement is omitted?
please help me..... please codes and flowchart plz turbo c lang po yan.....please asap response... 3. Make an astrology program. The user types in his or her birthday (month, day, and year as integer), and the program responds with the user’s zodiac sign, horoscope, and other information related to it. If the user’s birth year falls into a leap year, your program should display an appropriate message for it. NOTES: Conditional Statements: it should be with graphics
What is identifier in c?