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
#define f(g,h) g##h main O int i=0 int var=100 ; print f ("%d"f(var,10));} wat would be the output??
Write a program to know whether the input number is an armstrong number.
Why pointers are used in c?
How do I round numbers?
How do you define structure?
What is "Hungarian Notation"?
Difference between goto, long jmp() and setjmp()?
Explain what is a program flowchart and explain how does it help in writing a program?
Explain the difference between strcpy() and memcpy() function?
Is there any algorithm to search a string in link list in the minimum time?(please do not suggest the usual method of traversing the link list)
What does #pragma once mean?
5 Write an Algorithm to find the maximum and minimum items in a set of ‘n’ element.
Explain null pointer.
What are the advantages and disadvantages of a heap?
What are pointers? What are different types of pointers?