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

What is the purpose of 'register' keyword in c language?

629


Write the program with at least two functions to solve the following problem. The members of the board of a small university are considering voting for a pay increase for their 10 faculty members. They are considering a pay increase of 8%. Write a program that will prompt for and accept the current salary for each of the faculty members, then calculate and display their individual pay increases. At the end of the program, print the total faculty payroll before and after the pay increase, and the total pay increase involved.

2652


Who developed c language and when?

586


What is n in c?

575


What do you mean by command line argument?

646






Explain what is the benefit of using const for declaring constants?

614


How can I generate floating-point random numbers?

606


Tell me is null always defined as 0(zero)?

674


Can a function argument have default value?

672


What are the advantages of c preprocessor?

713


What is the difference between the = symbol and == symbol?

629


What is a volatile keyword in c?

638


What does 1f stand for?

614


Is c easy to learn?

558


What is pointer and structure in c?

574