write a program for even numbers?

Answer Posted / shruti

to print numbers which are even from 0 to 100

main()
{
int i;

puts("THE EVEN NUMBERS ARE:");

for(i = 0 ; i <= 100 ; i++)
{
if(i%2 == 0)
printf("%d", i);
}

}

Is This Answer Correct ?    23 Yes 14 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain why c is faster than c++?

575


p*=(++q)++*--p when p=q=1 while(q<=6)

1266


write a program to reverse a every alternetive words in a string in a place. EX: Input is "this is the line of text" Output should be "shit is eht line fo text" Please any one tell me code for that.

1577


What is the general form of function in c?

610


What does %p mean?

593






How can I automatically locate a programs configuration files in the same directory as the executable?

632


Design a program which assigns values to the array temperature. The program should then display the array with appropriate column and row headings.

1768


Describe the modifier in c?

601


What is the use of getchar functions?

674


If a five digit number is input through the keyboard, write a program to print a new number by adding one to each of its digits.For example if the number that is input is 12391 then the output should be displayed as 23402

3247


Can you apply link and association interchangeably?

677


Why is struct padding needed?

631


How can I find out if there are characters available for reading?

645


What is the scope of global variable in c?

556


What are reserved words?

654