Post Page Advertisement [Top]

Make pattern of A to Z with star* C-Programming

How to Make a Program in C to Make Capital E with star "*" ?

" Make a Program in C to Make Capital E with * "

Steps of programming:-

  1. Initialize two variable  (e.g: int x,y;)
  2. Start a loop from x=1 to x=7.
  3. In this loop first we use if statement for print"* * *" at the top.
  4. For printing "* * *" we simply start a loop from y=1 to y=3 because we want to print "*" 3-times.
  5. Then we use else if statement for print   "* * *" in the middle.
  6. And also for printing "* * *" we simply start a loop from y=1 to y=3 because we want to print "*" 3-times.
  7. Then again we use else if statement for print   "* * *" in the last.
  8. And again for printing "* * *" we simply start a loop from y=1 to y=3 because we want to print "*" 3-times.
  9. And in else section we simply print "*" 
  10. Then our program is completed.

code:


#include<stdio.h>
#include<conio.h>
void main()
{int x,y;
clrscr();
for (x=1;x<=7;x++)
{if(x==1)
       { printf("\n");
for (y=1;y<=3;y++)
printf("* "); }
else if(x==4)
       { printf("\n");
for (y=1;y<=3;y++)
printf("* ");   }
else if(x==7)
      { printf("\n") ;
for (y=1;y<=3;y++)
printf("* ");}
else
printf("\n*");   }

getch();
}
OUTPUT
DizIT_Operators
Thank-You 

No comments:

Post a Comment

Bottom Ad [Post Page]