For N=5, output should be
* * * *
*
*
*
*
* * * *
#include<stdio.h>
void main()
{
int i,n=5;
for(i=0; i<n-1; i++)
printf(" * ");
for(i=0; i<n-1; i++)
printf("\n*");
printf("\n");
for(i=0; i<n-1; i++)
printf(" * ");
}
//Output:
* * * *
*
*
*
*
* * * *
* * * *
*
*
*
*
* * * *
void main()
{
int i,n=5;
for(i=0; i<n-1; i++)
printf(" * ");
for(i=0; i<n-1; i++)
printf("\n*");
printf("\n");
for(i=0; i<n-1; i++)
printf(" * ");
}
//Output:
* * * *
*
*
*
*
* * * *
No comments:
Post a Comment