pyramid number

how to make a pyramid number
more description
the output must be in number start from 1.
last with 10.
ok, what is a pyramid number exactly? 1,4,9etc?
Show us what you expect the user to input and what the code should output.
Something like the following.

1
2
3
4
5
6
7
8
9
Input:
1
2
3

Output:
2
3
4


Let's say you wanted to increment each of the numbers by one, like in the example above.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include <iostream>
using std::cin;
using std::cout;
using std::endl;

#define NUMBER_OF_NUMBERS 3
int main()
{
	int number[NUMBER_OF_NUMBERS];

	// Take input.
	cout << "Please enter three numbers, one at a time." << endl;
	for (int i = 0; i < NUMBER_OF_NUMBERS; i++)
	{
		cin >> number[i];
		// The processing of each number happens here.
		number[i]++;
	}

	// Clear the screen.
	system("CLS");

	// Give output.
	cout << "The processed numbers are the following." << endl;
	for (int i = 0; i < NUMBER_OF_NUMBERS; i++)
		cout << number[i] << endl;

	return 0;
}
I figured you might wanted to do something like the following.

1
2
3
4
5
    11
   1111
  111111
 11111111
1111111111


Am I correct?
Last edited on
Topic archived. No new replies allowed.