C programming #include int main() { int i, j, n ; printf("height? ") ; scanf("%2d", &n) ; for (i = 1 ; i <= n ; i++) { // printf("%d: ", i) ; for (j = 1 ; j <= i ; j++) { // Pick *one* of the following // printf("%d", j % 10) ; printf("*") ; } printf("\n") ; } return 0 ; }   How can I get output like this by editing the given programming -- height? 5 * *** ***** ******* ********* and then how can I get the following?- height? 7  1  123  12345  1234567  123456789  12345678901  1234567890123

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter9: Completing The Basics
Section: Chapter Questions
Problem 7PP
icon
Related questions
Question
100%

C programming

#include <stdio.h>
int main() {
int i, j, n ;
printf("height? ") ;
scanf("%2d", &n) ;
for (i = 1 ; i <= n ; i++) {
// printf("%d: ", i) ;
for (j = 1 ; j <= i ; j++) {
// Pick *one* of the following
// printf("%d", j % 10) ;
printf("*") ;
}
printf("\n") ;
}
return 0 ;
}

 

How can I get output like this by editing the given programming --

height? 5
*
***
*****
*******
*********

and then how can I get the following?-

height? 7
 1
 123
 12345
 1234567
 123456789
 12345678901
 1234567890123

Expert Solution
steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Function Arguments
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr