Posts

Showing posts from October 13, 2012

PATTERN 7

Image
#include<stdio.h>
#include<conio.h>
void main()
{
int n,i,j,k,l,m,sp=1;
clrscr();
printf("Enter number \n");
scanf("%d",&n);
if(n%2==0)
sp=2;
for(i=1;i<=n;i++)
printf("*");
printf("\n");
for(k=n/2;k>=1;k--)
{
for(j=1;j<=k;j++)
printf("*");
for(l=sp;l>=1;l--)
printf(" ");
for(m=1;m<=k;m++)
printf("*");
printf("\n");
sp+=2;
}
sp-=2;
for(k=1;k<=n/2;k++)
{if(k!=1)
{for(j=1;j<=k;j++)
printf("*");
for(l=sp;l>=1;l--)
printf(" ");
for(m=1;m<=k;m++)
printf("*");
printf("\n");
}
sp-=2;
}
for(i=1;i<=n;i++)
printf("*");
getch();

}

SIMPLE PROGRAMS FIND TYPE OF THE TRIANGLETEMPERATURE CONVERSIONCOMMISSION OF A SALESMANPRINT NUMBERS IN DESCENDING ORDERBIGGEST NUMBER AMONG THREE NUMBERSCALCULATE DIVISIONA YEAR IS LEAP OR NOTA NUMBER IS ODD OR EVEN PRINT THE SQUARE ROOT ELSE PRINT N TO THE POWER 5PRINT A NEW NUMBER BY ADDING 1 TO EACH DIGIT OF THE NUMBER PRINT THE NO. OF…