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