Showing posts with label Alphabets in c. Show all posts
Showing posts with label Alphabets in c. Show all posts

Thursday, 12 July 2012

Pirnt BOX shape in C


#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,a,b,c,d;
  char hamza;
  clrscr();

printf("enter height");
scanf("%d",&a);

printf("enter your desire symbol =");
hamza=getche();
clrscr();

b=a+a;
c=b/2;
d=c+1;
for(i=1;i<=a;i++)
{
for(j=1;j<=b;j++)
{
if((j==1)||(j==c)||(j==d)||(j==b)||(i==1)||(i==a))
{
printf("%c",hamza);
}
else
{
printf(" ");
}
}
printf("\n");
}
getch();
}

Print Alphabet "B" in C


#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,e,l;
       clrscr();
       e=6/2;
       l=e+1;

for(i=1;i<=6;i++)

{
for(j=1;j<=6;j++)
{
if((j==1)||(j==6)||(i==1)||(i==6)||(i==l))
{
printf("*");
}
else

{
printf(" ");
}
}
printf("\n");
}
   getch();
}


Wednesday, 11 July 2012

Print Alphabet "I" in C


#include<stdio.h>
#include<conio.h>
void main()
{
  int i,p,a;
clrscr();
printf("enter the height =");
scanf("%d",&a);
for(i=1;i<=a;i++)
  {
  printf("*\n");
  }

 getch();
 }

Print Alphabet "I" in C


#include<stdio.h>
#include<conio.h>
void main()
{
  int i,p,a;
clrscr();
printf("enter the height =");
scanf("%d",&a);
for(i=1;i<=a;i++)
  {
  printf("*\n");
  }

 getch();
 }

Print Alphabet "L" in C


#include<stdio.h>
#include<conio.h>
void main()
{
int i,p,a;
clrscr();
  printf("enter the height =");
  scanf("%d",&a);
    for(i=1;i<=a;i++)
 {
  printf("*\n");
  }
   if(i==a+1)
  {
    for(p=1;p<=a;p++)
  {
    printf("*");
    }
    }
    getch();
}

Print Alphabet "M" in C


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


void main()
{
int i,j,b,a,r,g;
clrscr();
printf("enter height =");
scanf("%d",&a);
r=a+a;
g=r-1;
b=a+(a-1);
       for(i=1;i<=a;i++)
      {
for(j=0;j<=b;j++)
  {
  if((j==1)||(i==j)||(j==g)||(i==a-j+a))
    {
    printf("*");
    }
else
  {
  printf(" ");
   }
   }
   printf("\n");
   }


getch();
 }

Print Alphabet "V" in C


#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,b,a;
clrscr();
printf("enter height =");
scanf("%d",&a);
b=a+(a-1);
for(i=1;i<=a;i++)
{
for(j=1;j<=b;j++)
{
if((i==j)||(i==a-j+a))
{
printf("*");
}
else
{
printf(" ");
}
   }
   printf("\n");
}
   getch();
}

Print Alphabet "X" in C


#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,a;
clrscr();
printf("enter height =");
scanf("%d",&a);
         for(i=1;i<=a;i++)
         {
for(j=1;j<=a;j++)
  {
    if((i==j)||(i==a-j+1))
    {
    printf("*");
      }
    else
    {
     printf(" ");
     }

      }
     printf("\n");
     }

getch();
}

Print Alphabet "F" in C


#include<stdio.h>
#include<conio.h>
void main()
{
 int i,j,c,d,p,a;
 clrscr();
 printf("enter height =");
 scanf("%d",&a);
 c=a+1;
 d=c/2;

      for(i=1;i<=a;i++)
      {
    for(j=1;j<=a;j++)
    {
     if((i==1)||(i==d))
      {
       for(p=1;p<=a;p++)
{
printf("*");
}
break;
}
}
printf("*\n");
     }
getch();
}

Print Alphabet "H" in C



#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c,p,w,m,n;

clrscr();
printf("enter height =");
scanf("%d",&w);
m=w+1;
n=m/2;
for(a=1;a<=w;a++)
 {

  printf("*");

  for(b=1;b<=w;b++)
  {
   if(a==n)
    {
    for(p=1;p<=w;p++)
    {
    printf("*");
}
break;
     }
    printf(" ");
    }
    printf("*\n");
   }
   getch();
}

Tuesday, 10 July 2012

Print "Z" alphabet in C


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

/* print z in stars*/
void main()
{
int i=0, y=1, space, sp=1, limit;


clrscr();


printf("enter the limit");
scanf("%d",&limit);
space=limit-2;


     while (i++<limit)
     {
if(i==1|| i==limit)
  {
  while(y++ <= limit)
  {
  printf("*");
  }
y=1;
  printf("\n");
}
else
{
 while(sp++<=space)
  {
                   printf(" ");
    }


  printf("*");
  space--;
  printf("\n");
  sp=1;
  }
}

getch();
}