Pattern of barfi in c

C Program to create pattern

#include<conio.h>
#include<stdio.h>
void main()
{
    int i,j,k;
    clrscr();
    for(i=0;i<=5;i++)
    {
        for(j=5;j>=i;j--)
        printf("^");
        for(k=1;k<=2*i;k++)
        printf(" ");
        for(j=5;j>=i;j--)
        printf("^");
        printf("\n");
    }
    for(i=1;i<=6;i++)
    {
        for(j=1;j<=i;j++)
        printf("^");
        for(k=11;k>=2*i;k--)
        printf(" ");
        for(j=1;j<=i;j++)
        printf("^");
        printf("\n");
    }
    getch();
}

Output:


Comments

Popular posts from this blog

SKILL ROCKS TECH QUESTIONS

C Program for Analog Clock Design

Php Check is date or not