Answer to Question #16827 in C++ for marie

Question #16827
write a program that will display the following pattern, given the value of n.
example: if n=4, output
****
***
**
*
1
Expert's answer
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!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS