write a c program to print a given number as odd or even
without using loop statements,(no if ,while etc)
Answer Posted / dr:rahul
#include<stdio.h>
#include<conio.h>
void main()
{
int rahul;
printf("0 - odd number \t 1 - even number\n");
printf("enter the number :");
scanf("%d",&rahul);
printf(" %d ",rahul&1);
getch();
}
| Is This Answer Correct ? | 4 Yes | 14 No |
Post New Answer View All Answers
What is a file descriptor in c?
What is c value paradox explain?
Write the Program to reverse a string using pointers.
Which built-in library function can be used to match a patter from the string?
Draw a diagram showing how the operating system relates to users, application programs, and the computer hardware ?
What is the difference between Printf(..) and sprint(...) ?
When is a null pointer used?
Explain how can I read and write comma-delimited text?
how do you programme Carrier Sense Multiple Access
What is define directive?
What is the use of typedef in c?
Explain what is a 'null pointer assignment' error? Explain what are bus errors, memory faults, and core dumps?
int i[2], j; int *pi;i[0] = 1; i[1] = 5; pi = i; j = *pi + 1 + *(pi + 1)Value of j after execution of the above statements will be a) 7 b) 6 c) 4 d) pointer
Where are local variables stored in c?
Explain the ternary tree?