first time posting here, I'd like help with getting the output of the code upside down while still using the for commands, below is the best I can put in a clarification.
Desired Output: Actual Output:
123456 1*****
12345* 12****
1234** 123***
123*** 1234**
12**** 12345*
1***** 123456
Code:
#include <iostream>
using namespace std;
int main() {
int num, row, integ;
cout << "Please enter size: ";
cin >> integ;
for (row = 1; row <= integ; row++) {
for (num = 1; num <= row; num++) {
cout << num;
}
for (; num <= integ; num++) {
cout << "*";
}
cout << endl;
}
}
Aucun commentaire:
Enregistrer un commentaire