Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

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 << "
Please Enter Maximum Value to print Natural Numbers =  ";
	cin >> number;
	
	int i = number;
	
	cout << "
List of Natural Numbers from " << number << " to 1 are
"; 
	while(i >= 1)
  	{
		cout << i <<" ";
		i--;
  	}
		
 	return 0;
}
Source by www.tutorialgateway.org #
 
PREVIOUS NEXT
Tagged: #program #print #natural #numbers #reverse #order #loop
ADD COMMENT
Topic
Name
1+9 =