- 1

HOW TO GET 122333444455555666666777777788888888

how to get that in output in c

28th Apr 2018, 4:19 PM
Jordan
Jordan  - avatar
4 Answers
+ 1
for (int i = 1; i <= 8; ++i) for (int j = 0; j != i; ++j) printf("%d", i);
28th Apr 2018, 4:32 PM
Timon Paßlick
0
write two inside loop. outer goes to eight and inner to outer iterator for i=1 to 8 for j=1 to i print j
28th Apr 2018, 4:30 PM
sajede mirzaei
sajede mirzaei - avatar
28th Apr 2018, 4:35 PM
TurtleShell
TurtleShell - avatar
0
#include <stdio.h> int main() { for (int i=1,x=1;i<=8;i++,x=i){ while(x>0){ printf("%d",i); x--; } } }
28th Apr 2018, 7:38 PM
Louis
Louis - avatar