You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
525 B
C

/* Pattern Problem
1
2 2
3 3 3
4 4 4 4
5 5 5 5 5
*/
#include <stdio.h>
#include <conio.h>
void main()
{
int i, j ;
clrscr() ;
printf("Required pattern is as follows: \n") ;
for(i=1 ; i<=5 ; i++)
{
/* Printing from left to Centre */
for(j=1 ; j<=i ; j++)
printf("%d ", i) ;
printf("\n") ;
}
getch();
}
/*
Output:
Required pattern is as follows:
1
2 2
3 3 3
4 4 4 4
5 5 5 5 5
*/