C++ Code TO Print Following:

 C++ Code TO Print Following:
========================

10 9 8 7 6 5 4 3 2 1
9 8 7 6 5 4 3 2 1
8 7 6 5 4 3 2 1
7 6 5 4 3 2 1
6 5 4 3 2 1
5 4 3 2 1
4 3 2 1
3 2 1
2 1
1



CODE
======

#include <iostream>
using namespace std;
int main()
{
int any1=10;

for(int x=10;x>0;x--){
for(int y=x;y>0;y--)
{ cout<<" "<<y;
}
cout<<endl;
}
}

No comments:

Post a Comment