- 1
HOW TO GET 122333444455555666666777777788888888
how to get that in output in c
4 Answers
+ 1
for (int i = 1; i <= 8; ++i)
for (int j = 0; j != i; ++j)
printf("%d", i);
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
0
#include <stdio.h>
int main() {
for (int i=1,x=1;i<=8;i++,x=i){
while(x>0){
printf("%d",i);
x--;
}
}
}