Program to print number 9 in C Language without Graphics
// Program to print number 9 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((j==4) && (i!=1 && i!=7))
printf("* ");
else if(j==1 && (i==2 || i==3 || i==6))
printf("* ");
printf("* "); //star and space
printf(" "); //double space
}
printf("\n"); //new line
}
return 0;
}
Output:
* *
* *
* *
* *
* * *
* * *
*
* *
* *
* *
Program to print number 8 in C Language without Graphics
// Program to print number 8 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((j==1 || j==4) && (i!=1 && i!=4 && i!=7))
printf("* ");
else if((i==1 || i==4 || i==7) && j>=2 && j<=3)
printf("* "); //star and space
printf(" "); //double space
}
printf("\n"); //new line
}
return 0;
}
Output:
* *
* *
* *
* *
* *
* *
* *
* *
* *
* *
Subscribe to:
Posts (Atom)