Search
 
SCRIPT & CODE EXAMPLE
 

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;
}
Comment

PREVIOUS NEXT
Code Example
Cpp :: quick sort c+++ 
Cpp :: c++ pass array to a function 
Cpp :: ascii conversion cpp 
Cpp :: how to print a text in c++ 
Cpp :: cpp absolute value 
Cpp :: how to specify the number of decimal places in c++ 
Cpp :: c++ progress bar 
Cpp :: lua table contains 
Cpp :: c++ struct 
Cpp :: cpp func as const 
Cpp :: card validator c++ 
Cpp :: gettimeofday header file 
Cpp :: c define 
Cpp :: c++ squaroot 
Cpp :: Disabling console exit button c++ 
Cpp :: c++ vector remove all duplicate elements 
Cpp :: quicksort 
Cpp :: Visual studio code include path not working c++ 
Cpp :: how to generate number in c++ 
Cpp :: find substring in string c++ 
Cpp :: log base 2 in c++ 
Cpp :: c++ integer array 
Cpp :: dice combinations cses solution 
Cpp :: how to sort array in c++ 
Cpp :: c++ std string to float 
Cpp :: use of strstr in c++ 
Cpp :: how to reset linerenderer unity 
Cpp :: intlen in c++ 
Cpp :: read a whole line from the input 
Cpp :: cpp malloc 
ADD CONTENT
Topic
Content
Source link
Name
2+5 =