0

How do I write a C++ for loop that displays the following set of numbers:

0, 10, 20, 30, 40, 50 ..... 1000

I don't know anything about loops, so any help will be much appreciated

Thank you much. :)

3
Contributors
5
Replies
7
Views
9 Years
Discussion Span
Last Post by Jboy05
0

ok when I do it to 1000, it only starts counting from 702

int main()
{
  // declare a variable
  int i;
  for(i= 0; i < 1001; i++)
    cout << i << endl;



     system("PAUSE"); 
     return 0;
}
0
#include <iostream>
using namespace std;

int main() {
	for(int i = 0; i <= 1000; i+=10){
		cout << ' ' << i;
	}
	return 0;
}
0

It's works but why does it show so many zeros in additon to the other numbers

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.