what's wrong with this code, when i try to make the pyramid, it's always the same height of the pyramid. and somehow onumber always has the value of 20, WHY??!!
Here is the code and I'll also include a picture of how it looks.
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
int number;
int onumber;
number = onumber;
char value;
cout << "what character do you want to fil the pyramid with? >> ";
cin >> value;
cout << "\nHow many lines shall the pyramid be? >> ";
cin >> number;
int i =0;
int y = number;
while(i < onumber) {
cout.width(y);
cout.fill(' ');
cout << "";
y--;
cout.width(number-(number-(number-1)));
cout.fill(value);
cout << "" << endl;
++number;
++number;
onumber--;
}
cin.get();
cin.get();
return 0;
}