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