+ 3

How to print the following output using for loop

1 2 3 4 5 6 7 8 9 10

11th Jun 2017, 12:33 PM
Thirumurugan C
Thirumurugan C - avatar
8 Respuestas
+ 8
@faisal i think the answer was asked in java....
11th Jun 2017, 12:48 PM
cHiRaG GhOsH
cHiRaG GhOsH - avatar
+ 5
Here Is The Code, Wait I'm Writing... #include <iostream> using namespace std; int main() { int row, number = 1; cout << "Enter number of rows: "; cin >> row; for(int i = 1; i <= row; i++) { for(int j = 1; j <= i; ++j) { cout << number << " "; ++number; } cout << endl; } return 0; }
11th Jun 2017, 12:42 PM
m8riix
m8riix - avatar
+ 5
Thank you @ Justin Hill
11th Jun 2017, 1:02 PM
Thirumurugan C
Thirumurugan C - avatar
+ 4
int count=1; for(int i=0; i<5;i++){ for(int j=0; j<i; j++){ System.out.print(count + " "); count++; } System.out.println(); }
11th Jun 2017, 12:50 PM
LordHill
LordHill - avatar
+ 4
So sorry 😉, I don't know java & I also didn't see that java tag
11th Jun 2017, 12:58 PM
m8riix
m8riix - avatar
+ 4
@chirag you are right - I didn't see that 😊
11th Jun 2017, 12:59 PM
m8riix
m8riix - avatar
+ 4
No problem Faisal Reza Thank you
11th Jun 2017, 1:02 PM
Thirumurugan C
Thirumurugan C - avatar
+ 2
check This Out
11th Jun 2017, 12:42 PM
m8riix
m8riix - avatar