Answer to Question #13831 in C++ for Darryl kaye Sanga
Write a program that will display the following pattern, given the value of n.
example: if n=4, output
*
**
***
****
1
2012-08-30T11:46:25-0400
#include<stdio.h>
#include<conio.h>
int main()
{
int num,r,c;
printf("Enter loop repeat number(rows): ");
scanf("%d",&num);
for(r=1; num>=r; r++)
{
for(c=1; c<=r; 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