if i input 5, then the output will be
11 12 13 14 15
12 13 14 15
13 14 15
14 15
15
if i input 4, then the output
12 13 14 15
13 14 15
14 15
15
if i input 3, then
13 14 15
14 15
15
what is the code?
Last edited on
#include <iostream>
using namespace std;
main(){
int n, akhir=15, nil;
cout<<"Masukkan Bilangan : "; cin>>n;
for(int i=n; i>=1; i--){
for(int j=i; j>0; j--){
nil = akhir - j+1;
cout<<nil<<" ";
}
cout<<endl;
}
}
i found it, thanks
Last edited on