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


Please Help Members By Posting Answers For Below Questions

Write a program to swap two numbers without using a temporary variable?

612


What is huge pointer in c?

586


explain what is fifo?

635


What are the keywords in c?

644


Explain how many levels deep can include files be nested?

629






What is the general form of #line preprocessor?

588


What is scope and lifetime of a variable in c?

579


What is realloc in c?

581


What are the different data types in C?

730


Explain main function in c?

630


What is a shell structure examples?

592


Add Two Numbers Without Using the Addition Operator

356


Which one to choose from 'initialization lists' or 'assignment', for the use in the constructor?

571


What is difference between constant pointer and constant variable?

631


What does the function toupper() do?

658