Write a pro-gramme to determine whether the number is even or odd?
Answer Posted / azad sable, chiplun
void main();
{
int n;
clrscr();
printf("enter any number");
scanf("%d",&n);
if(n%2==0)
printf("\nthe number is even");
else
printf("\nthe number is odd");
}
getch();
}
| Is This Answer Correct ? | 5 Yes | 0 No |
Post New Answer View All Answers
How do you view the path?
#define MAX(x,y) (x) >(y)?(x):(y) main() { inti=10,j=5,k=0; k= MAX(i++,++j); printf("%d..%d..%d",i,j,k); }
What is the difference between printf and scanf in c?
Should I use symbolic names like true and false for boolean constants, or plain 1 and 0?
Write a program to replace n bits from the position p of the bit representation of an inputted character x with the one's complement. Method invertBit takes 3 parameters x as input character, p as position and n as the number of positions from p. Replace n bits from pth position in 8 bit character x. Then return the characters by inverting the bits.
Is Exception handling possible in c language?
write a program that reads lines(using getline), converts each line to an integer using atoi, and computes the average of all the numbers read. also compute the standard deviation.
What is the benefit of using const for declaring constants?
What is c variable?
Can we compile a program without main() function?
7-Given an index k, return the kth row of the Pascal's triangle. For example, when k = 3, the row is [1,3,3,1]. For reference look at the following standard pascal’s triangle.
What is difference between stdio h and conio h?
Here is a neat trick for checking whether two strings are equal
How do we print only part of a string in c?
How do you use a pointer to a function?