find a number whether it is even or odd without using any
control structures and relational operators?
Answer Posted / shashi
#include<stdio.h>
main()
{
int n;
string s[2]={"Even","odd"};
Printf("Enter the number");
scanf("%d",&n);
n=n%2;
printf("The value is %s",s[n]);
}
Is This Answer Correct ? | 11 Yes | 2 No |
Post New Answer View All Answers
What is difference between %d and %i in c?
How the c program is executed?
How pointers are declared?
What is use of #include in c?
Write a c program to demonstrate character and string constants?
What is extern c used for?
In c programming language, how many parameters can be passed to a function ?
What is a pointer in c?
What is the difference between malloc calloc and realloc in c?
Why do we use header files in c?
what is use of malloc and calloc?
What is selection sort in c?
1.int a=10; 2.int b=20; 3. //write here 4.b=30; Write code at line 3 so that when the value of b is changed variable a should automatically change with same value as b. 5.
How does normalization of huge pointer works?
How to write a program for machine which is connected with server for that server automatically wants to catch the time for user of that machine?