Monday, 24 December 2012
A simple star printing program #3
Do you like this story?
That's the code for another simple star(*) printing program:
and the output is like:
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,k,l;
clrscr;
printf("enter how many rows:");
scanf("%d",&k);
for(i=1;i<=k;i++)
{
for(j=1;j<=k-i;j++)
{
printf(" ");
}
for(l=1;l<=i;l++)
{
printf("* ");
}
printf("\n");
}
getch();
}
This post was written by: Franklin Manuel
Franklin Manuel is a professional blogger, web designer and front end web developer. Follow him on Twitter
Subscribe to:
Post Comments (Atom)
0 Responses to “A simple star printing program #3”
Post a Comment