Professional Documents
Culture Documents
C Programs
C Programs
#include<stdio.h>
#include<conio.h>
Void main()
Clrscr();
Int i,j,k=10,l=10;
For(i=0;i<=10;i++)
K=l;
For( ;k>=0;k--)
Printf(“\t”);
For(j=0;j<=i;j++)
Printf(“* \t”);
Printf(“\n”);
L=l-1;
Getch();
Otput:::::::
* *
* * *
DIAMOND PROGRAM
#include<stdio.h>
#include<conio.h>
Void main()
{
Clrscr();
Int i,j,k=10,l=10;
For(i=0;i<=10;i++)
{
K=L;
For( ;k>=0;k--)
Printf(“ “);
For(j=0;j<=i;j++)
{
Printf(“* “);
}
Printf(“\n”);
L=L-1;
}
K=1;
L=1;
For(i=1;i<=10;i++)
{
K=L
For(k=0;k<=i;k++)
Printf(“ “);
For(j=10;j>=i;j--)
{
Printf(“* “);
}
Printf(“\n”);
L=L+1;
}
Getch();
}