Is there a program to print even numbers between 1 to 1000 in C
Is there a program to print even numbers between 1 to 1000 in C++?
6 ANSWERS
Vibhor Kashyap (विभोर कश्यप), I make Android Apps!
I wasn't able to compile it but it should work.
If you wish to learn more basic programs like this then you should check out this app which has programs of C, C++ and Java.
- /*Program to find even numbers between 1 to 100 */
- # include <iostream.h>
- # include <conio.h>
- int main ( )
- {
- int counter;
- cout<<"Even numbers between 1 to 1000 are:"<<endl ;
- for (counter = 1; counter <= 1000; counter++)
- {
- if ( counter%2 == 0)
- {
- cout<<counter<<"\t"<<endl ;
- }
- }
- return 0;
- }
3.4k Views
RELATED QUESTIONS (MORE ANSWERS BELOW)
OTHER ANSWERS
for(I=1;I<=100;I++)
{
If(i%2==0)
{
cout<<I;
}
}
{
If(i%2==0)
{
cout<<I;
}
}
Post a Comment