Answers for "c++ program to print natural numbers from 1 to 10 in reverse order using while loop"

C++
0

c++ program to print natural numbers from 1 to 10 in reverse order using while loop

#include<iostream>
using namespace std;

int main()
{
	int number;
	
	cout << "nPlease Enter Maximum Value to print Natural Numbers =  ";
	cin >> number;
	
	int i = number;
	
	cout << "nList of Natural Numbers from " << number << " to 1 aren"; 
	while(i >= 1)
  	{
		cout << i <<" ";
		i--;
  	}
		
 	return 0;
}
Posted by: Guest on January-12-2022

Code answers related to "c++ program to print natural numbers from 1 to 10 in reverse order using while loop"

Browse Popular Code Answers by Language