Tuesday, August 13, 2019

This Program is mostly asked for interview.

     This Program is mostly asked for interview:


 This Program is mostly asked for interview.


     *
    ***
   *****
  *******
 *********
 *********
  *******
   *****
    ***
     *

#include<stdio.h>
#include<conio.h>

void main()
{
int i,j,k;
clrscr();
for(i=1;i<=5;i++)
{
for(j=5;j>=i;j--)
{
printf("0");
}
for(k=1;k<=2*i-1;k++)
{
printf("*");
}
printf("\n");
}
for(i=5;i>=1;i--)
{
for(j=5;j>=i;j--)
{
printf("0");
}
for(k=1;k<=2*i-1;k++)
{
printf("*");
}
printf("\n");
}
getch();
}


EmoticonEmoticon