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

how much salary u want ? why u join in our company? your domain is core sector why u prefer software ?

1507


How reliable are floating-point comparisons?

632


write a program to reverse a every alternetive words in a string in a place. EX: Input is "this is the line of text" Output should be "shit is eht line fo text" Please any one tell me code for that.

1580


What is wrong with this code?

698


Write a c program to build a heap method using Pointer to function and pointer to structure ?

4182






What is preprocessor with example?

591


What is typedef?

681


What is a protocol in c?

561


What are keywords in c with examples?

608


There is a practice in coding to keep some code blocks in comment symbols than delete it when debugging. How this affect when debugging?

827


Why should I prototype a function?

644


write a c program to find the largest and 2nd largest numbers from the given n numbers without using arrays

1788


Explain do array subscripts always start with zero?

763


What would happen to X in this expression: X += 15; (assuming the value of X is 5)

1308


Difference between macros and inline functions? Can a function be forced as inline?

715