60 469
Assignments Done
98,1%
Successfully Done
In April 2018

Answer to Question #55531 in C for Ric Jumagdao

Question #55531
C not C++ Number patter pyramid dont include the parenthesis.Example enter a number n=4 the output is
***1
**21
*321
4321
Expert's answer
#include <stdio.h>

using namespace std;
int main(int argc, char **argv)
{
int i,j, n;
printf("Input n: ");
scanf("%d",&n);
for(i=0;i<n;i++)
{
for(j=0;j<n-i-1;j++)
printf(" ");
for(j=n-i-1;j<n;j++)
printf("%d",n-j);
printf("\n");
}

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 first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions