Wednesday, May 14, 2014

Star Pattern Program in C




/*Star Pattern Program in C

Author - Chinmay Mahajan*/


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

void main()
{
int i,j,k,m,o,f,n;
clrscr();
printf("Enter value of n \n");
scanf("%d",&n);
k=n;
o=1;
for(i=0;i<n;i++) //for number of lines
{

for(j=0;j<k;j++) //for left spacing
{
printf("_");
}
for(m=0;m<o;m++) //for Printing *
{
printf(" *");
}

for(f=0;f<k;f++)  //for right spacing
{
printf("_");
}
printf("\n"); //new line
k--;
o++;
}//outer for
}//main

1 comment:

  1. We are one of the best graphic designing,course in bangalore. We offer course with affordable fees. Digitalents academy is one of the top institute in bangalore. This graphic designing course is highly informative and well-structured! The lessons are practical, and the insights shared are very useful for beginners as well as professionals. Highly recommended for anyone looking to upskill in graphic designing! Visit Digitalents Academy

    ReplyDelete