Posted by : Unknown
Wednesday, February 3, 2016
Ans:
#include<stdio.h>
#include<conio.h>
int main()
{
int num,c,sp,r=1;
printf("Enter loop repeat number(rows): ");
scanf("%d", &num);
printf("\n");
for(; num>=1; num--,r++)
{
for(c=1; c<=num; c++)
printf("*");
for(sp=r; sp>1; sp--)
printf(" ");
for(sp=r; sp>1; sp--)
printf(" ");
for(c=num; c>=1; c--)
printf("*");
printf("\n");
}
return 0;
}
#include<conio.h>
int main()
{
int num,c,sp,r=1;
printf("Enter loop repeat number(rows): ");
scanf("%d", &num);
printf("\n");
for(; num>=1; num--,r++)
{
for(c=1; c<=num; c++)
printf("*");
for(sp=r; sp>1; sp--)
printf(" ");
for(sp=r; sp>1; sp--)
printf(" ");
for(c=num; c>=1; c--)
printf("*");
printf("\n");
}
return 0;
}
Related Posts :
- Back to Home »
- Star Patterns »
- 30.Reverse Order Triangle Praymid using *'s as shown below.