So, I have tweaked it some and now I have it giving the out put
1
212
23123
2341234
I am having a major pain trying to figure out how to make the 2nd inner loop reverse the number order and make the out put take on the form of a triangle. Maybe its because of frustration.
Code:
#include <iostream>
#include <iomanip>
using namespace std;
int main ()
{
int n , i , j , k;
cout << "Enter an integer between 1 and 15:" << endl;
cin >> n;
cout << endl;
while ( n < 0 || n > 16 )
{
cout << "Invalid input! Input must be between";
}
for ( i = 0 ; i < n ; i++ )
{
for( j = 2 ; j <= i + 1 ; j++)
{
cout << setw(3) << j;
}
for ( k = 1 ; k <= i + 1 ; k++ )
{
cout << setw(3) << k;
}
cout << endl;
}
return 0;
}