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


Please Help Members By Posting Answers For Below Questions

What is pointer & why it is used?

852


When was c language developed?

962


Explain what is wrong with this program statement?

902


what is the difference between class and unio?

2143


Write the program that calculates and prints the average of several integers. Assume that the last value read is sentinel 9999.

3441


Explain what is the difference between text files and binary files?

902


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?

1066


Who invented bcpl language?

969


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

3140


Write a C program in Fibonacci series.

882


How do I read the arrow keys? What about function keys?

874


What does typeof return in c?

877


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

1031


Explain what is the concatenation operator?

883


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'); }

971