In this tutorial, we will discuss Reverse number pattern in Cpp using while loop
In C++ language, we can use for loop, while loop, do-while loop to display various number, star, alphabet and binary number patterns
In this topic, we demonstrate how to display some reversed number patterns using the nested while loop in Cpp language.
pattern 1
Reverse pyramid pattern 1
Reverse number pattern program 1
#include
#include
using namespace std;
int main()
{
int j,rows;//variable declaration
cout<<"Enter the number of rows: ";
cin>>rows;//take input from user for rows
cout<<"\n";//move to next line
while(rows>=1){
int j=rows;
while(j>=1){
cout<
When the above code is compiled and executed, it produces the following results
#include
#include
using namespace std;
int main()
{
int j,rows;//variable declaration
cout<<"Enter the number of rows: ";
cin>>rows;//take input from user for rows
cout<<"\n";//move to next line
int i;
while(rows>=0){
for(i=1; i<=rows; i++){
cout<
When the above code is compiled and executed, it produces the following results