To find whether a number is even or odd without using any
conditional operator??
Answer Posted / kala
main()
{
int n;
printf("enter the number\n");
scanf("%d",&n);
if(n%2==0){
printf("number is even");}
else{
printf("number is odd");
}
}
or
if(n&1==0)
printf("even number");
else
printf(odd number");
| Is This Answer Correct ? | 31 Yes | 38 No |
Post New Answer View All Answers
Explain what are multibyte characters?
In C language, a variable name cannot contain?
How can variables be characterized?
How many bytes is a struct in c?
Write a simple code fragment that will check if a number is positive or negative.
How can I display a percentage-done indication that updates itself in place, or show one of those twirling baton progress indicators?
Distinguish between actual and formal arguments.
How do I get a null pointer in my programs?
the real constant in c can be expressed in which of the following forms a) fractional form only b) exponential form only c) ascii form only d) both a and b
Can include files be nested?
What are examples of structures?
How can you increase the size of a dynamically allocated array?
general for is %wd,f-d; in this system "w" means a) 'w' represent total width of digits b) 'w' represent width which includes the digits before,after decimal place and the decimal point c) 'w' represent width which includes the digits before only d) 'w' represent width after decimal place only
Explain Function Pointer?
Who invented b language?