Answer to Question #16827 in C++ for marie
write a program that will display the following pattern, given the value of n.
example: if n=4, output
****
***
**
*
1
2012-10-19T09:03:18-0400
#include<stdio.h>
#include<conio.h>
int main()
{
int num,c;
printf("Enter loop repeat number(rows): ");
scanf("%d",&num);
for(; num>=1; num--)
{
for(c=1; c<=num; c++)
printf("*");
printf("
");
}
getch();
return 0;
}
Need a fast expert's response?
Submit order
and get a quick answer at the best price
for any assignment or question with DETAILED EXPLANATIONS!
Learn more about our help with Assignments:
C++
Comments
Leave a comment