0
How write logic for this
1 23 456 78910
5 Respostas
+ 2
this is the code in js
we want to do five loops and every time we loop we increase the number of items by one .
Inside the small loops we concatenate the items ,then print the the concatenated items .
var x = '';
var num = 1;
var m = 1;
for (i = 1; i <= 5; i++) {
for(;m<=i; m++){
x += num;
num ++;
}
document.writeln(x+'<br >');
}
0
Have you got some other examples ?
0
Nope
0
in c++ I can write
0
Okay write will see c+