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
What is pointer & why it is used?
When was c language developed?
Explain what is wrong with this program statement?
what is the difference between class and unio?
Write the program that calculates and prints the average of several integers. Assume that the last value read is sentinel 9999.
Explain what is the difference between text files and binary files?
When reallocating memory if any other pointers point into the same piece of memory do you have to readjust these other pointers or do they get readjusted automatically?
Who invented bcpl language?
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
Write a C program in Fibonacci series.
How do I read the arrow keys? What about function keys?
What does typeof return in c?
This is a variation of the call_me function in the previous question:call_me (myvar)int *myvar;{ *myvar += 5; }The correct way to call this function from main() will be a) call_me(myvar) b) call_me(*myvar) c) call_me(&myvar) d) expanded memory
Explain what is the concatenation operator?
What are the output(s) for the following ? #include char *f() {char *s=malloc(8); strcpy(s,"goodbye")} main() { char *f(); printf("%c",*f()='A'); }