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
Explain the difference between ++u and u++?
What are compound statements?
which of the following statement is wrong a) mes=123.56; b) con='T'*'A'; c) this='T'*20; d) 3+a=b;
Write a code to determine the total number of stops an elevator would take to serve N number of people.
What is self-referential structure in c programming?
What is the meaning of 2d in c?
Is calloc better than malloc?
How can I find out the size of a file, prior to reading it in?
How can I trap or ignore keyboard interrupts like control-c?
Explain pointer. What are function pointers in C?
What is the significance of an algorithm to C programming?
Can a function argument have default value?
Compare array data type to pointer data type
Explain can static variables be declared in a header file?
Explain what is the purpose of "extern" keyword in a function declaration?