To find whether a number is even or odd without using any
conditional operator??
Answer Posted / umair jatoi && zain ja
/* ZAIN JATOI AND UMAIR JATOI */
#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
int n;
printf("Enter any number:");
scanf("%d",&n);
if(n&1)
printf("%d is Odd number",n);
else
printf("%d is even number",n);
getch();
}
| Is This Answer Correct ? | 2 Yes | 2 No |
Post New Answer View All Answers
What is the scope of static variable in c?
The difference between printf and fprintf is ?
How can you pass an array to a function by value?
What is a pragma?
Explain c preprocessor?
a way in which a pointer stores the address of a pointer which stores the value of the target value a) reference b) allocation c) multiple indirection d) none
can anyone suggest some site name..where i can get some good data structure puzzles???
why return type of main is not necessary in linux
Explain what is meant by 'bit masking'?
Give basis knowledge of web designing ...
#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); }
Dont ansi function prototypes render lint obsolete?
Explain what are run-time errors?
what is the basis for selection of arrays or pointers as data structure in a program
What is the right type to use for boolean values in c?