/* WAP TO PRINT THE FOLLOWING FORMAT :-
*
* *
* * *
* * * *
* * * * *
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j;
int row,space;
clrscr();
printf("Enter the no. of rows you want= ");
scanf("%d",&row);
clrscr();
space=row-1;
for(i=1;i<=row;i++)
{
for(j=1;j<=space;j++)
{
printf(" "); // 2-SPACES.
}
for(j=1;j<=i;j++)
{
printf("* "); // 1 * & 3-SPACES.
}
printf("\n");
space=space-1;
}
getch();
}
*
* *
* * *
* * * *
* * * * *
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j;
int row,space;
clrscr();
printf("Enter the no. of rows you want= ");
scanf("%d",&row);
clrscr();
space=row-1;
for(i=1;i<=row;i++)
{
for(j=1;j<=space;j++)
{
printf(" "); // 2-SPACES.
}
for(j=1;j<=i;j++)
{
printf("* "); // 1 * & 3-SPACES.
}
printf("\n");
space=space-1;
}
getch();
}
No comments:
Post a Comment