Computers and Technology
Computers and Technology, 25.03.2020 06:38, aly95

(1) The given program outputs a fixed-height triangle using a * character. Modify the given program to output a right triangle that instead uses the user-specified triangleChar character.
(2) Modify the program to use a nested loop to output a right triangle of height triangleHeight. The first line will have one user-specified character, such as % or *. Each subsequent line will have one additional user-specified character until the number in the triangle's base reaches triangleHeight. Output a space after each user-specified character, including after the line's last user-specified character.
Example output for triangleChar = % and triangleHeight = 5: Enter a character: % Enter triangle height: 5 %

#include

int main(void) {
char triangleChar;
int triangleHeight;

printf("Enter a character:\n");
scanf("%c", &triangleChar);

printf("Enter triangle height:\n");
scanf("%d", &triangleHeight);
printf("\n");

//you solution here
return 0;
}

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 10:40, pbarbee3034
Nims is applicable to all stakeholders with incident related responsibilities. true or false
Answers: 1
image
Computers and Technology, 22.06.2019 11:00, babbybronx
Lisa’s company, abc ltd., lost its biggest client and is now facing a financial crunch. most of her colleagues have resigned, but lisa decides to stay with the company and assist the management in overcoming the financial situation. which quality is lisa demonstrating? a. self-management b. cooperativeness c. responsibility d. loyalty
Answers: 2
image
Computers and Technology, 22.06.2019 12:00, Cocco
Which of the following does 3d animation create an illusion of on the screen? a. depth b. emotion c. length d. dialogue
Answers: 1
image
Computers and Technology, 24.06.2019 05:30, MegRasmussen31
Hey i really need some solving this problem: 1. encrypt this binary string into cipher text: 110000. include in your answer the formula the decoder would use to decrypt your cipher text in the format (coded answer) x n mod (m) = y & 2. decrypt this cipher text into a binary string: 106 you.
Answers: 2
Do you know the correct answer?
(1) The given program outputs a fixed-height triangle using a * character. Modify the given program...

Questions in other subjects:

Konu
Health, 13.11.2020 14:00
Konu
English, 13.11.2020 14:00
Konu
Mathematics, 13.11.2020 14:00