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
In C programming, what command or code can be used to determine if a number of odd or even?
write a c program to calculate sum of digits till it reduces to a single digit using recursion
What is meant by operator precedence?
What is substring in c?
How does #define work?
Where static variables are stored in c?
Why do we use main function?
What is an lvalue in c?
A collection of data with a given structure for excepting storing and providing on demand data for multiple users a) linked list b) datastructer c) database d) preprocessor
what is the diffrenet bettwen HTTP and internet protocol
A SIMPLE PROGRAM OF GRAPHICS AND THEIR OUTPUT I WANT SEE WAHAT OUTOUT OF GRAPHICS PROGRAM
Difference between goto, long jmp() and setjmp()?
What is pointer to pointer in c with example?
Why is structure padding done in c?
What is function and its example?