Skip to main content
C Program to print the number pattern 1
Write a C program to implement the number pattern 1
1
12
123
1234
12345
#include<stdio.h>
int main()
{
printf("The star pattern is:\n");
int i,j,k=0;
for(i=0;i<5;i++)
{
printf("\n");
k=0;
for(j=0;j<5;j++)
{
if(i>=j)
printf("%d ",++k);
else
printf(" ");
}
}
}
Output:
Comments
Post a Comment