find a number whether it is even or odd without using any
control structures and relational operators?
Answer Posted / mohd parvez 09311349697
#include<stdio.h>
#include<conio.h>
void main()
{
int num;
printf("Enter a number:");
scanf("%d",&num);
num%2&&printf("Number is ODD")||printf("Number is EVEN");
getch();
}
| Is This Answer Correct ? | 1 Yes | 2 No |
Post New Answer View All Answers
int i=10; printf("%d %d %d", i, i=20, i);
What is c mainly used for?
Explain how can a program be made to print the line number where an error occurs?
Explain what is meant by 'bit masking'?
Write the syntax and purpose of a switch statement in C.
How can I swap two values without using a temporary?
what value is returned to operating system after program execution?
If null and 0 are equivalent as null pointer constants, which should I use?
I was asked to write a program in c which when executed displays how many no.of clients are connected to the server.
Can I initialize unions?
Can include files be nested?
Can you define which header file to include at compile time?
What does double pointer mean in c?
A float occupies 4 bytes in memory. How many bits are used to store exponent part? since we can have up to 38 number for exponent so 2 ki power 6 6, 6 bits will be used. If 6 bits are used why do not we have up to 64 numbers in exponent?
Explain can the sizeof operator be used to tell the size of an array passed to a function?