//Program to print alphabet W 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<=5;j++)
{
if(j==1 || j==5)
printf(" *"); //allow space and star
else if(i>=3 && (i==j || j==5-i+1))
printf(" *"); //allow space and star
else
printf(" "); //allow double space
}
printf("\n"); //new line
}
return 0;
#include<stdio.h>
int main()
{
int i, j;
for(i=1;i<=5;i++)
{
printf("\t"); //for horizontal tab
for(j=1;j<=5;j++)
{
if(j==1 || j==5)
printf(" *"); //allow space and star
else if(i>=3 && (i==j || j==5-i+1))
printf(" *"); //allow space and star
else
printf(" "); //allow double space
}
printf("\n"); //new line
}
return 0;
No comments:
Post a Comment