find a number whether it is even or odd without using any
control structures and relational operators?
Answer Posted / rohit agarwal
#include<stdio.h>
#include<conio.h>
main()
{
int n;
char *p[]={"Even","odd"};
clrscr();
printf("Enter the number");
scanf("%d",&n);
n=n%2;
printf("The value is %s",p[n]);
getch();
| Is This Answer Correct ? | 1 Yes | 2 No |
Post New Answer View All Answers
What is the meaning of && in c?
What is memcpy() function?
What extern c means?
What is a loop?
Multiply an Integer Number by 2 Without Using Multiplication Operator
What does a function declared as pascal do differently?
What is the g value paradox?
Explain what is meant by high-order and low-order bytes?
What are conditional operators in C?
Why is sizeof () an operator and not a function?
What is the right type to use for boolean values in c? Is there a standard type?
Explain about the functions strcat() and strcmp()?
Program will then find the largest of three numbers using nested if-else statements. User is prompted to enter three numbers. Program will find the largest number and display it on the screen. All three numbers entered by the user are also displayed. If user enters 21, 33, and 5, the output should be as follows: You entered: 21, 33 and 5. The largest number is 33.
Is register a keyword in c?
What is the meaning of 2d in c?