LIVE Course for free

Rated by 1 million+ students
Get app now
0 votes
735 views
in Review of C++ Programming by (32.1k points)
closed by

Write a C++ program to print to get the following output.

1

2   3

4    5   6

7    8     9    10

1 Answer

+1 vote
by (31.8k points)
selected by
 
Best answer

#include

using namespace std;

int main()

{

int i,j,k=1;

for(i=1;i<5;i++)

{

for(j=1;j<=i;j++)

cout<<k++<" ";

cout<<endI;

}

}

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

Categories

...