Post Page Advertisement [Top]

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

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

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

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=5 because we want to print "*" 5-times.
  5. Then we use else if statement for print   "* * *" in the last.
  6. And also for printing "* * *" we simply start a loop from y=1 to y=5 because we want to print "*" 5-times.
  7. And in else section we simply print "*" 
  8. 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)
for(y=1;y<=4;y++)
printf(" *");
else if (x==7)
      { printf("\n");
for(y=1;y<=4;y++)
printf(" *");  }
else
printf("\n*");
}
getch();
}

c programming
OUTPUT


#DizIT_Operators

Thank-You 

No comments:

Post a Comment

Bottom Ad [Post Page]