find a number whether it is even or odd without using any
control structures and relational operators?
Answer Posted / abhradeep chatterjee
ya. the first answer has impressed me.
#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 ? | 5 Yes | 1 No |
Post New Answer View All Answers
Write a program to swap two numbers without using a temporary variable?
What is huge pointer in c?
explain what is fifo?
What are the keywords in c?
Explain how many levels deep can include files be nested?
What is the general form of #line preprocessor?
What is scope and lifetime of a variable in c?
What is realloc in c?
What are the different data types in C?
Explain main function in c?
What is a shell structure examples?
Add Two Numbers Without Using the Addition Operator
Which one to choose from 'initialization lists' or 'assignment', for the use in the constructor?
What is difference between constant pointer and constant variable?
What does the function toupper() do?