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

What are dangling pointers? How are dangling pointers different from memory leaks?

607


What are the rules for identifiers in c?

579


Explain the use of 'auto' keyword in c programming?

668


How does struct work in c?

600


Sir,please help me out with the code of this question. Write an interactive C program that will encode or decode multiple lines of text. Store the encoded text within a data file, so that it can be retrieved and decoded at any time. The program should include the following features: (a) Enter text from the keyboard, encode the text and store the encoded text in a data file. (b) Retrieve the encoded text and display it in its encoded form. (c) Retrieve the encoded text, decode it and then display the decoded text. (d) End the computation. Test the program using several lines of text of your choice.

1753






FORMATTED INPUT/OUTPUT functions are a) scanf() and printf() b) gets() and puts() c) getchar() and putchar() d) all the above

612


what is the diffrenet bettwen HTTP and internet protocol

1379


How can I get the current date or time of day in a c program?

643


Are comments included during the compilation stage and placed in the EXE file as well?

660


How can I display a percentage-done indication that updates itself in place, or show one of those twirling baton progress indicators?

568


Is c procedural or object oriented?

565


What is a loop?

543


Is r written in c?

716


Can i use “int” data type to store the value 32768? Why?

742


Explain what is the difference between #include and #include 'file' ?

571