Hi, I have this program that outputs a triangle when given the size.
Right now the triangle outputs like this
5
*
**
***
****
*****
Does anyone know how I would make it look like this?
5
1
12
123
1234
12345
Thanks in advanced for looking at my post.
#include<iostream>
using namespace std;
int main(){
int num, row;
cin>>num;
for(row=0;row<num;row++)
{
for (int a=0; a<=row;a++)
{
cout<<"*";
}
for (int b=num;b>row+1;b--)
cout<<" ";
cout<<endl;
}
cin.ignore();
cin.ignore();
return 0;
}