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

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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can you convert integers to binary or hexadecimal?

815


How can I open files mentioned on the command line, and parse option flags?

841


Who invented b language?

1163


How will you write a code for accessing the length of an array without assigning it to another variable?

844


What is ctrl c called?

801


What is the modulus operator?

959


How can I trap or ignore keyboard interrupts like control-c?

835


Why c language is called c?

765


How can I remove the trailing spaces from a string?

842


Why do we use pointer to pointer in c?

829


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

822


what is uses of .net

1493


What is else if ladder?

815


how to make a scientific calculater ?

1825


Why is c called a structured programming language?

1015