lundi 6 mai 2019

How can we access an output as below? (Number-Multiplication sign)

I am writing code in c++ which must have an output hereinbelow:

1******

12*****

123****

1234***

12345**

123456*

1234567

I have done displaying integers but the issue is to couple up "*" sign to them.

Here is the code:

#include<iostream>
using namespace std;
int main () {
    int i,j;
    for(int i=1;i<8;i++) {
        for(int j=1;j<=i;j++){

    cout<<j; 
    } cout<<endl;}

return 0;
}

Thank you. This is the output of the process I have done until.

Aucun commentaire:

Enregistrer un commentaire