find a number whether it is even or odd without using any
control structures and relational operators?
Answer Posted / vamsi
#include<stdio.h>
main()
{
int n;
string p[2]={"Even","odd"};
Printf("Enter the number");
scanf("%d",&n);
n=n%2;
printf("The value is %s",p[n]);
}
Is This Answer Correct ? | 13 Yes | 8 No |
Post New Answer View All Answers
i got 75% in all semester am i eligible for your company
What does %d do?
When do we get logical errors?
What are the types of data files?
What do you mean by c what are the main characteristics of c language?
What is a pointer in c?
explain what are actual arguments?
Explain Function Pointer?
Where static variables are stored in memory in c?
Write a program to identify if a given binary tree is balanced or not.
What are bitwise shift operators in c programming?
How many header files are in c?
Are there namespaces in c?
if the area was hit by a virus and so the decrease in the population because of death was x/3 and the migration from other places increased a population by 2x then annually it had so many ppl. find our the population in the starting.
How can I direct output to the printer?