Answer Posted / kamal
* read a number … */
#include <stdio.h>
int main (void) {
int num; /* input number */
int rem; /* remainder …*/
/* get number from user */
printf(“Please enter a number: ”);
scanf(“%d”, &num);
/* calculate remainder … */
rem = num % 2;
if (rem == 0) {
printf(“even\n”);
} else {
printf(“odd\n”);
}
/* terminate program */
return 0;
}
| Is This Answer Correct ? | 4 Yes | 6 No |
Post New Answer View All Answers
How can I change their mode to binary?
What are lookup tables in c?
How do I get an accurate error status return from system on ms-dos?
What is memory leak in c?
Explain the use of 'auto' keyword in c programming?
How are Structure passing and returning implemented by the complier?
How pointer is different from array?
Why do we use & in c?
List some of the static data structures in C?
What do you understand by friend-functions? How are they used?
What is the meaning of 2d in c?
What is scanf_s in c?
A function can make the value of a variable available to another by a) declaring the variable as global variable b) Passing the variable as a parameter to the second function c) Either of the two methods in (A) and (B) d) binary stream
What is return type in c?
Array is an lvalue or not?