find a number whether it is even or odd without using any
control structures and relational operators?
Answer Posted / vishal jain
#include<stdio.h>
#include<conio.h>
int main()
{
int num;
printf("Enter any Number : \n");
scanf("%d",&num);
char *s[2]={"Even","Odd"};
printf("%s",s[num&1]);
return 0;
}
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is d scanf?
In C language, a variable name cannot contain?
What is a pointer on a pointer in c programming language?
Why main is not a keyword in c?
What the advantages of using Unions?
What is data types?
Can the curly brackets { } be used to enclose a single line of code?
What is int main () in c?
application attempts to perform an operation?
What extern c means?
Can you please explain the difference between strcpy() and memcpy() function?
the statement while(i) puts the entire logic in loop. this loop is called a) indefinite loop b) definite loop c) loop syntax wrong d) none of the above
write a C program: To recognize date of any format even formats like "feb-02-2003","02-february-2003",mm/dd/yy, dd/mm/yy and display it as mm/dd/yy.
develop algorithms to add polynomials (i) in one variable
What is the use of linkage in c language?