Example & Tutorial understanding programming in easy ways.

Write a program to print the following : 1 12 123 1234 12345

program:

#include<stdio.h>

int main()

{

int a,b;

for(a=1; a<6;a++)

{

for(b=1; b<a;b++)

{

printf("%d",b);
}

printf("n");
}

}


output:

1

12

123

1234

12345

Read More →