+ 4

I want to print a series 1 to 5

1 12 123 1234 12345

8th Oct 2017, 1:24 PM
Himanshu Ranjan
Himanshu Ranjan - avatar
3 Réponses
+ 11
for (int i=1;i <6;i++) { cout<<"\n"; for (j=1;j <i;j++) { cout <<j; } }
8th Oct 2017, 1:38 PM
khadeeja Shamna
khadeeja Shamna - avatar
+ 10
public class patternhelp{ public static void main (String []args){ for(int a=1;a <=5;a++){ for (int b=1;b<=a;b++) System.out.print(b); System.out.println(""); } } } https://code.sololearn.com/c5oI6I06c7P4/?ref=app
8th Oct 2017, 1:39 PM
Gaurav Agrawal
Gaurav Agrawal - avatar
+ 4
JavaScript: for (i=1, serie=""; i<6; i++) { serie += i; console.log(serie + "\r"); } Welcome.
18th Oct 2017, 10:05 AM
Power'f GOD⚡⚡
Power'f GOD⚡⚡ - avatar