i need to create a program that produces an amount of stairs based on the number user inputs.
for example the stairs will look like this if the user enters 4 :
X
XX
XXX
XXXX
however im having difficulty doing this , here is my code so far:
#include<iostream>
#include"110ct.h"
#include<string>
using namespace std;
int main()
{
int a;
cout << " please enter a number dude\n";
cin >> a;
for( int i = 1 ; i<=a ; ++ i)
{
cout << "x" << endl;
for(int j= 1 ; j<=a; ++j)
{
//cout <<" x" << endl;
}
}
#include <iostream>
#include <iomanip>
usingnamespace std;
int main ()
{
for (int k=4; k>0; k--)
{
for (int m=k; m>0; m--)
cout <<"*";
cout <<endl;
}
return 0;
}
shows up as:
****
***
**
*
All the information should be here, just got to change it to meet your criteria. If you can't figure it out, I'll try to help with conforming it to what you want. (And just as a side note, this is my first time helping out here, I'm fairly new to C++, so I very well could be wrong. Just trying to help out.)