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

Answers were Sorted based on User's Feedback



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

Answer / 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

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

Answer / sridhar

#include<stdio.h>
#include<conio.h>
main()
{
int a,b,c,d; /*declaring variable using int*/
clrscr();
printf("enter the numbers:")
scanf("/n%d/n%d",&a,&b);/*getting number using scanf*/
c=a,b;
d=(c/2==0);
printf("the even number is:%d",d)/*print the final answer*/
getch();
}

Is This Answer Correct ?    8 Yes 25 No

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

Answer / guest

#nclude<stdio.h>
#include<conio.h>
void main()
{
int a,b,c;
clrscr();
printf("\n Enter the numbers for a,b,c:");
scanf("%d%d",&a,&b);
c=a/b;
c=0;
printf("The given number is even");
getch();
}

Is This Answer Correct ?    6 Yes 57 No

Post New Answer

More C Interview Questions

what is the value of 'i'? i=strlen("Blue")+strlen("People")/strlen("Red")-strlen("green")

7 Answers   Cadence, JNTU, Zen Technologies,


An interactive c program to read basic salary of 15 persons. each person gets 25% of basic as HRA, 15%of basic as conveyance allowances, 10%of basic as entertainment allowances.The total salary is calculated by adding basic+HRA+CA+EA.Calculate how many out of 15 get salary above 10,000.Rs also print the salary of each employee

2 Answers  


What is I ++ in c programming?

0 Answers  


what is the program to display your name in any color?

2 Answers   HCL,


What are the 4 data types?

0 Answers  






Why we use break in c?

0 Answers  


hello freinds next week my interview in reliance,nybody has an idea about it intervew questions..so tell

0 Answers   Reliance,


I have seen function declarations that look like this

0 Answers  


which of the following go out of the loopo if expn 2 becoming false a.while(expn 1){...if(expn 2)continue;} b.while(!expn 1){if(expn 2)continue;...} c.do{..if(expn 1)continue;..}while(expn 2); d.while(!expn 2){if(expn 1)continue;..}

4 Answers   TCS,


how to use enum datatype?Please explain me?

3 Answers   Excel,


what is the importance of spanning tree?

0 Answers  


Find greatest number out of 10 number without using loop.

5 Answers   TCS,


Categories