C program to print following pattern 1 22 333 4444

/*
Program to print the pattern
1
22
333
4444
55555
*/

#include<stdio.h>
#include<conio.h>
void main()
{
 int i,j,n;
 clrscr();
 printf("\n Enter the value of n:");
 scanf("%d",&n);
 for(i=0;i<=n;i++)
 {
  for(j=1;j<=i;j++)
  {
printf("%d",i);
  }
 printf("\n");
 }
getch();

}

Output:


5 comments:

100 C Programs with Code and Output

Program 1: C Program To Read Two Numbers And Print The Sum Of Given Two Numbers. Program 2: C Program To Read Three Numbers And Prin...