Monday, 24 December 2012

A simple star printing program #1


That's the code for a simple star(*)  printing program: 

#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,k;
clrscr;
printf("enter how many rows:");
scanf("%d",&k);
for(i=1;i<=k;i++)
{
for(j=1;j<=i;j++)
{
printf("*");
}
printf("\n");
}
getch();
}

and the output is like:

0 Responses to “A simple star printing program #1”

Post a Comment

Recent Comments

All Rights Reserved Assignments on C language