Posts

Showing posts with the label pattern

Pattern of barfi in c

Image
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++)   ...

Perform looping with if statement.

Image
C Program to  create if loop #include<conio.h> #include<stdio.h> void main() {     int i,j,k,l=1;     clrscr();     i=1;     i1:     if(i<=5)     {         j=4;         j1:         if(j>=i)         {             printf(" ");             j--;             goto j1;         }         k=1;         k1:         if(k<=l)         {             printf("*");             k...