Techiio-author
Started by Anik AdhikaryMay 7, 2022

Open
How to write a program in C++ to display the pattern like right angle triangle with a number ?

6 VIEWES 0 LIKES 0 DISLIKES SHARE
0 LIKES 0 DISLIKES 6 VIEWES SHARE
Expected Output :
1
12
123
1234
12345
123456
1234567
12345678
123456789
12345678910

1 Replies

Techiio-commentatorSidhdarth Basu replied 15 days ago0 likes0 dislikes
#include <iostream>
using namespace std;
int main()
{
   int i,j,rows;
    cout << "\n\n Display the pattern using number starting from 1:\n";
    cout << "------------------------------------------------------\n";
    cout << " Input number of rows: ";
    cin >> rows;
   for(i=1;i<=rows;i++)
   {
	for(j=1;j<=i;j++)
	   cout<<j;
	cout<<endl;
   }	
}
You must be Logged in to reply
Techiio-logo

Techiio is on the journey to build an ocean of technical knowledge, scouring the emerging stars in process and proffering them to the corporate world.

Follow us on:

Subscribe to get latest updates

You can unsubscribe anytime from getting updates from us
Developed and maintained by Wikiance
Developed and maintained by Wikiance