Dry run
Tue Oct 24 2023 15:33:39 GMT+0000 (Coordinated Universal Time)
Saved by
@yolobotoffender
#include <iostream>
#include<cmath>
using namespace std;
int main() {
int k,j;
cout<<"Enter the Number"<<endl;// enter 10
cin>>k;
int z=0,i=1;
while (i <= k){
z=z+i;
i=i+1;
}
while (k >=1){
j=1;
while (j <= k){
cout<<z-k+j<<" ";
j=j+1;
}
z=z-k;
cout<<endl;
k=k-1;
}
return 0;
}
content_copyCOPY
Comments