C Program Code for Printing Heart Shape

Program Code:

#include<stdio.h>
int main()
{
int i,j,k,l,m,n,o,p,q,r,s,t;
printf("\n\n\n\n\n");

for(i=0;i<15;i++)
printf(" ");
printf("*         *\n");

for(j=0;j<13;j++)
printf(" ");
printf("*   *     *   *\n");

for(k=0;k<11;k++)
printf(" ");
printf("*      *   *      *\n");

for(l=0;l<11;l++)
printf(" ");
printf("*       * *       *\n");

for(m=0;m<11;m++)
printf(" ");
printf("*        *        *\n");

for(n=0;n<11;n++)
printf(" ");
printf("*                 *\n");

for(o=0;o<12;o++)
printf(" ");
printf("*               *\n");

for(p=0;p<13;p++)
printf(" ");
printf("*             *\n");

for(q=0;q<14;q++)
printf(" ");
printf("*           *\n");

for(r=0;r<15;r++)
printf(" ");
printf("*         *\n");

for(s=0;s<17;s++)
printf(" ");
printf("*     *\n");

for(t=0;t<20;t++)
printf(" ");
printf("**\n");
return 0;
}

Output:

.exe file

No comments:

Post a Comment

Please disable your ad blocker to support this website.

Our website relies on revenue from ads to keep providing free content.