Question: Problem Statement Please modify the following code to use only the DO - WHILE loops. The program prompts a user for an integer input. It
Problem Statement
Please modify the following code to use only the DOWHILE loops. The program prompts a user for an integer input. It takes an input as a size of a triangle. The program will output the triangle to the screen.
#include
int main
int size ;
int i ;
int j ;
prompt a user for an input
printfPlease input an int as a size of a triangle: ;
scanfd &size;
output a triangle to the screen
printf
Print triangle
;
for ;i size; i
j i;
whilej
printf#;
printf
;
return ;
Output example
Please input an int as a size of a triangle:
Print triangle
#
##
###
####
#####
Partial Solution
Please try to implement the assignment code in your IDE first and compare your source code with the following partial solution code. Complete the following code for the assignment credit.
#include
int main
int size ;
int i ;
int
j
;
prompt a user for an input
printfPlease input a int as a size of a triangle: ;
scanfd
&size
;
output a triangle to the screen
printf
Print triangle
;
do
j i;
while
printf#;
j
;
printf
;
i
size
return
;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
