76 383
Assignments Done
98,1%
Successfully Done
In May 2019

Answer to Question #48227 in C for keerthana

Question #48227
c program that reads positive integer n & print the following pattern
**********
-*********
--********
---*******
----******
-----*****
------****
-------***
--------**
---------*
Expert's answer
/* Answer on Question#48227 - Subject - Programming, C */
#include <cstdlib>
#include <iostream>
using namespace std;
int main()
{
int nn=0, n, k;
int i,d,a;
printf("enter positive n- number: ");
scanf("%d",&n);
k = n;
for (i=0; i<n; i++)
{
for (d=0; d<nn; d++)
printf("-");

for (a=k; a>0; a--)
printf("*");

k--;
nn++;
printf("\n");
}

system("PAUSE");
return EXIT_SUCCESS;
}


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