Pattern in c++
printing pattern of numbers
C++ programs
code for c++
C++ code for demonstrate printing pattern of program
source code:
// C++ code to demonstrate printing
// pattern of numbers
#include <iostream> // iostream provides basic
// input and output services for C++ programs
using namespace std;
int main()// Th execution of program start with the main function
// Nested for loop
{
// Outer loop to handle number of rows
for(int i = 5; i > 0; i--){
// Inner loop to handle number column
for(int j = 1; j <= i; j++)
cout<<j<<" ";
cout<<"\n";
}
}
0 Comments