#include <stdio.h>
void print_square(int size);
int main()
{
int size;
//promp for size of square
printf("Enter size of square: ");
//read size
scanf("%d", &size);
//print square depending on size
print_square(size);
system("pause");
}
//This function prints a square of starts (size x size)
void print_square(int size)
{
//declare variables
int i,j;
//i is the horizontal row (eg row 1, row 2, row i)
for(i=1; i<=size; i++)
{
//j is the position in the row (eg position 1, position 2, position j)
for(j=1; j<=size; j++)
{
//if the first or last row put a star in the position in the row
if((i==1) (i==size))
{
printf("* ");
}
//for the in between rows
else
{
//put a star on the side positions of the row
if((j==1) (j==size))
{
printf("* ");
}
//put an empty space in the row
else
{
printf(" ");
}
}
}
//print new row in new line
printf("\n");
}
system("pause");
}
Try the triangle program on a search engine. Replace numbers with stars and that should do the trick
To write "4 and a half stars," you can use a combination of numeric and symbolic representations. You might write it as "4.5 stars" or "4½ stars." Alternatively, you can express it in words as "four and a half stars."
Write a function that print a triangle of stars.
Sterne
No.
Some will, some won't. Depends who you write to and how busy they are at the time.
an arrangement of stars in the constellations Andromeda and Pegasus that forms a huge uneven square
You cannot legally obtain Sonic and Sega All Stars racing for free.
Yes.
Lois Lowry was the author of Number The Stars.
The "Stars and Stripes"
whitney houston