Pattern Prgram in C Language with Answers. In this tutorial we have discussed pattern program questions with solution.We have shared program based on star pattern, number pattern, pyramid pattern and alphabet pattern. We have discussed both basics and advanced level program in this tutorial

Star (*) Pattern Program in C

In C Language patterns parograms are the best way to learn and practice loops. If anybody wants to improve their logical part then they must practice these programs. Following are the example of Star (*) pattern program in c Language.

Star (*) Pattern Example :- 1

*
**
***
****
*****


#include<stdio.h>
int main(){
int i,j,x;
printf("Enter value");
scanf("%d",&x);
for(i=1; i<=x;i++)
{
    for(j=1;j<=i;j++){
        printf("*");
    }
    printf("\n");
}

return 0;
}
		


Star (*) Pattern Example :- 2

*****
****
***
**
*


#include<stdio.h>
int main()
{
    int i,j,x;
    printf("Enter value");
    scanf("%d",&x);
    for(i=1; i<=x; i++)
    {
        for(j=i; j<=x; j++)
        {
            printf("*");
        }
        printf("\n");

    }


    return 0;
}
		


Number Pattern Program in C

Following are the example of numeric pattern programs

Number Pattern Example :- 1

1
22
333
4444
55555


#include<stdio.h>
int main()
{
    int i,j,x;
    printf("Enter value ");
    scanf("%d",&x);
    for(i=1; i<=x; i++)
    {
        for(j=1;j<=i; j++)
        {
            printf("%d",i);
        }
        printf("\n");
    }

    return 0;
}

		


Number Pattern Example :- 2

1
12
123
1234
12345


#include<stdio.h>
int main()
{
    int i,j,x;
    printf("enter value ");
    scanf("%d",&x);
    for(i=1; i<=x;i++)
    {
        for(j=1;j<=i; j++)
        {
            printf("%d",j);
        }
        printf("\n");
    }

    return 0;
}
		


Number Pattern Example :- 3

1
23
345
4567
56789


#include<stdio.h>
int main()
{
    int i,j;
    for(i=1; i<=5; i++)
    {
        for(j=i;j<=(i*2)-1; j++)
        {
            printf("%d",j);
        }
        printf("\n");
    }


    return 0;
}
		


Number Pattern Example :- 4

1
21
321
4321
54321


#include<stdio.h>
int main()
{
    int i,j,x;
    printf("Enter value ");
    scanf("%d",&x);
    for(i=1; i<=x; i++)
    {
        for(j=i;j>=1;j--)
        {
            printf("%d",j);
        }
        printf("\n");
    }

    return 0;
}
		


Number Pattern Example :- 5

55555
4444
333
22
1


#include<stdio.h>
void main()
{
    int i,j,x;
    printf("Enter your number");
    scanf("%d",&x);
    for(i=x; i>=1; i--)
    {
        for(j=1; j<=i; j++)
        {
            printf("%d",i);
        }
        printf("\n");
    }
}