Need help.

Is it impossible to make the pyramid pattern without entering a number?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
  #include <iostream>
using namespace std;
int main()
{
    int i,j=5,num;
    cout<<"Enter the number: ";
    cin>>num;
    for(i=1;i<=num;++i)
    {
        for(j=1;j<=i;++j)
        {
           cout<<"*";
        }
        cout<<endl;
    }
    return 0;
}
If you want the size to always be the same set the value for num

num=10;
Last edited on
Topic archived. No new replies allowed.