C/C++ PROGRAM AND TUTORIAL
Pattern: 1 12 123 1234 12345
Write a program to print
1
12
123
1234
12345
#include <stdio.h>
main()
main()
{ int i,n,j;
printf("\nEnter the range value:");
scanf("%d",&n);
printf("\nThe pattern is:\n");
for(i=1;i<=n;i++)
{ for(j=1;j<=i;j++)
printf("%d",j);
printf("\n"); } }
=====================================================================
No comments:
Post a Comment