Monday, 24 December 2012
A simple star printing program #2
Do you like this story?
That's the code for another simple star(*) printing program:
#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(l=1;l<=k-i;l++)
{
printf(" ");
}
for(j=1;j<=i;j++)
{
printf("* ");
}
printf("\n");
}
getch();
}
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(l=1;l<=k-i;l++)
{
printf(" ");
}
for(j=1;j<=i;j++)
{
printf("* ");
}
printf("\n");
}
getch();
}
and the output is like:
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)
1 Responses to “A simple star printing program #2”
14 January 2022 at 19:51
Lucky 7 - Sega Genesis | Konicasino rb88 rb88 188bet 188bet 카지노사이트 카지노사이트 카지노 카지노 カジノ シークレット カジノ シークレット 251 Spades Tournament Rules | Player Profile - FFBasino
Post a Comment