Thursday, June 30, 2016

C Program to Print Pattern like character C.

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:
 * * * *
*
*
*
*
 * * * *


No comments:

Post a Comment