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
Tell me the use of bit field in c language?
What is #define in c?
what is bit rate & baud rate? plz give wave forms
What are volatile variables in c?
what is the significance of static storage class specifier?
Why is c used in embedded systems?
If jack lies on Mon, Tue Wed and jill lies on Thursday, Friday and Saturday. If both together tell they lied yesterday. So c the given options and then c cos in the given dates one will be saying the truth and one will be lying. I got Thursday as option because jack is saying the truth he lied yest but jill is lying again as he lies on that day.
What is #line used for?
What is pragma c?
What are the 5 organizational structures?
What is a macro in c preprocessor?
What is a static variable in c?
Simplify the program segment if X = B then C ← true else C ← false
What are pointers really good for, anyway?
What is c mainly used for?