/* 1. Program to print the following output.
/* 2. Program to print the following output.
*****
*****
*****
*****
*****
*/
#include <stdio.h>
int main()
{
int i, j;
for(i=1; i<=5; i++)
{
//Print trailing spaces
for(j=1; j<=5-i; j++)
{
printf(" ");
}
//Print stars after spaces
for(j=1; j<=5; j++)
{
printf("*");
}
//Moves to the next line/row
printf("\n");
}
return 0;
}
/* 2. Program to print the following output.
********************
********************
********************
********************
********************
*/
#include <stdio.h>
int main()
{
int i, j;
for(i=1; i<=5; i++)
{
//Print trailing spaces
for(j=1; j<=5-i; j++)
{
printf(" ");
}
//Print stars after spaces
for(j=1; j<=20; j++)
{
printf("*");
}
//Moves to the next line/row
printf("\n");
}
return 0;
}