// Program to print number 5 in C language with CBhashaGyan
#include<stdio.h>
int main()
{
int i, j;
for (i=1; i<=7; i++)
{
printf("\t"); //for horizontal tab
for(j=1; j<=4; j++)
{
if( i==1 || (j==4 && ( i==5 || i==6)))
printf("* "); //to allow star with space
else if(j==1 && ( i!=1 && i!=5 && i!=7))
printf("* "); //to allow star with space
printf("* "); //allow star with space
else
printf(" "); //for double space
}
printf("\n"); //for new line
}
return 0;
}
Output:
* * * *
*
*
*
* * *
*
* *
* *
* *
No comments:
Post a Comment