#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; }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter