Write a programme to find even numbers without using any
conditional statement?

Answer Posted / mathiyazhagan

#include<stdio.h>
main()
{
char res[2][5]={"Even","Odd"};
int n;
printf("Enter a number :");
scanf("%d",&n);
printf("the given no is = %s",res[n%2]);
}

Is This Answer Correct ?    51 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is variable and explain rules to declare variable in c?

545


Find MAXIMUM of three distinct integers using a single C statement

614


Write the syntax and purpose of a switch statement in C.

610


Write a program to swap two numbers without using third variable in c?

605


Explain how can I avoid the abort, retry, fail messages?

581






the statement while(i) puts the entire logic in loop. this loop is called a) indefinite loop b) definite loop c) loop syntax wrong d) none of the above

596


What does void main return?

597


Why shouldn’t I start variable names with underscores?

616


Explain the Difference between the New and Malloc keyword.

674


Explain how can you check to see whether a symbol is defined?

648


How do you convert a decimal number to its hexa-decimal equivalent.Give a C code to do the same

643


What do you understand by normalization of pointers?

614


what are bit fields in c?

596


What are the different types of control structures?

573


What does the error 'Null Pointer Assignment' mean and what causes this error?

732