/* C program to print the given star pattern
* * * * *
* * * * *
* * * * *
* * * * *
* * * * * * * * * * * * * * * * *
* * * * *
* * * * *
* * * * *
* * * * *
*/
#include<conio.h>
#include <stdio.h>
void main()
{
int i,j,k,m;
for(i=1;i<=5;i++) //for number of rows. there are five rows so loop moves fives times
{
for(j=1;j<=5;j++) // for number of columns
{
printf("* ");
}
printf("\n"); // for next rows
}
for(i=1;i<=15;i++) // for middle line (star;long line)
{
printf("* ");
}
printf("\n");
for(i=1;i<=5;i++) //for number of rows. there are five rows so loop moves fives times
{
for(m=1;m<=20;m++) // for spaces. suppose there are 20 spaces.
{
printf(" ");
}
for(j=1;j<=5;j++) // for number of columns display. it is second part.
{
printf("* ");
}
printf("\n"); // for next rows
}
getch();
}
* * * * *
* * * * *
* * * * *
* * * * *
* * * * * * * * * * * * * * * * *
* * * * *
* * * * *
* * * * *
* * * * *
*/
#include<conio.h>
#include <stdio.h>
void main()
{
int i,j,k,m;
for(i=1;i<=5;i++) //for number of rows. there are five rows so loop moves fives times
{
for(j=1;j<=5;j++) // for number of columns
{
printf("* ");
}
printf("\n"); // for next rows
}
for(i=1;i<=15;i++) // for middle line (star;long line)
{
printf("* ");
}
printf("\n");
for(i=1;i<=5;i++) //for number of rows. there are five rows so loop moves fives times
{
for(m=1;m<=20;m++) // for spaces. suppose there are 20 spaces.
{
printf(" ");
}
for(j=1;j<=5;j++) // for number of columns display. it is second part.
{
printf("* ");
}
printf("\n"); // for next rows
}
getch();
}
No comments:
Post a Comment