I have used CodeBlocks compiler for debugging purpose. But you can use any C++ programming language compiler as per your availability.
#include <iostream>
using namespace std;
int main()
{
int num=0, i;
//Reading number
cout<<"Enter any number: "<<endl;
cin>>num;
/*Running loop from the number entered by user,
and Decrementing by 1*/
for(i=num; i>=1; i--)
{
cout<<i;
}
return 0;
}
I have used CodeBlocks compiler for debugging purpose. But you can use any C++ programming language compiler as per your availability.
Result:
Enter any number:
10
10987654321
need an explanation for this answer? contact us directly to get an explanation for this answer