write a program for even numbers?

Answer Posted / mehak saini

include<stdio.h>
include<conio.h>
void main()
{
inti,num;
printf("enter the number")
scanf(%d",&num);
for(i=1;i=<num;i+1)
{
if(i%2==0)
{
printf("%d",i);
}
}
getch();
}

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain what does it mean when a pointer is used in an if statement?

614


Write a Program to accept different goods with the number, price and date of purchase and display them

5445


2) Write a program that will help Air Traffic Control for an airport to view the sequence of flights ready for take-off. The airport can accommodate 10 flights waiting for take-off at any point in time. Each flight has a unique 3 digit numeric identifier.  Each time a flight takes-off, Air Traffic Control adds a flight to the waitlist. Each time a flight is added to the waitlist, the list of flights waiting to take-off must be displayed.  When a flight is cleared for take-off, Air Traffic Control removes the flight from the waitlist. Each time a flight takes-off, the list of flights waiting to take-off must be displayed.  Sequence of take-off is the sequence of addition to the waitlist

2515


why use "return" statement a) on executing the return statement it immediately transfers the control back to the calling program b) it returns the value present in the parentheses return, to the calling program c) a & b d) none of the above

608


Explain what is the benefit of using enum to declare a constant?

588






What does & mean in scanf?

601


Explain how can you be sure that a program follows the ansi c standard?

859


What does %c do in c?

584


Explain main function in c?

624


A float occupies 4 bytes in memory. How many bits are used to store exponent part? since we can have up to 38 number for exponent so 2 ki power 6 6, 6 bits will be used. If 6 bits are used why do not we have up to 64 numbers in exponent?

1775


Are the expressions * ptr ++ and ++ * ptr same?

667


Hai what is the different types of versions and their differences

1486


What is a void pointer in c?

606


typedef struct{ char *; nodeptr next; } * nodeptr ; What does nodeptr stand for?

1068


what are # pragma staments?

1624