1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Tcecarenko [31]
2 years ago
14

This program will output a right triangle based on user specified height triangleHeight and symbol triangleChar. It is strongly

suggested to use the for loop for this solution.
(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

< stdio.h >


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");


printf("* \n");

printf("* * \n");

printf("* * * \n");


return 0;

}
Computers and Technology
1 answer:
nasty-shy [4]2 years ago
4 0

The program illustrates the use of loops;

Loops are program statements that are used to perform repetition

<h3>The complete program</h3>

The modified program in C, is as follows:

#include<stdio.h>

int main(void) {

   char triangleChar; int triangleHeight;

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

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

   for (int i = 0; i<triangleHeight; i++){

       printf("\n");

       for(int j = 0;j<=i;j++){

           printf("%c",triangleChar);

       }

   }

   return 0;

}

Read more about loops at:brainly.com/question/24833629

#SPJ1

You might be interested in
Integrated circuits are made up of _____ and carry an electrical current
Rasek [7]

Answer:

integrated circuits are made up of Transistor and carry an electrical current

4 0
4 years ago
What happens if two functions are defined with the same name, even if they are in different arguments within the same .py files?
yan [13]

Answer:

Following are the code to this question:

def data(a):#defining method data that accepts parameter

   print (a)#print parameter value

def data(b):#defining method data that accepts parameter

   print (b)#print parameter value

x=input("enter value: ")#defining variable x that5 input value from user

print(data(x))#call method data

Output:

enter value: hello..

hello..

None

Explanation:

  • As the above code, it is clear defines that python doesn't support the method overloading because More than one method can't be specified in a python class with the same name and python method arguments have no type.
  • The single argument method may be named using an integer, a series, or a double value, that's why we can say that it is not allowed.
7 0
3 years ago
If you have a list of words that you wish to make into a bulleted list, you must first highlight or ________ the words with your
motikmotik
<h3>Answer:</h3>

C. select

<h3>Explanation:</h3>

A. if you delete the words you can make them into a bulleted list

B. if you remove them you can make them into a bulleted list neither

D. Copying the words doesn't need for that

Hope it helped you

3 0
4 years ago
A Windows user is locked out of her computer, and you must log into the local administrator account Helpdesk Admin. Which would
Damm [24]

Answer:

B is the correct answer

5 0
3 years ago
January 19/May 16 2022
fenix001 [56]

Answer:

This should get you started. Many things could be improved. You could keep adding layers to this program if you wanted to, so I wrote it with that in mind.

The new salary depends on the employee's department and current salary. I created a class that represents each employee. The function looks at the employee's current salary, and looks up what the employee's department raise will be (using the dictionary/hash table) before performing the calculation.

3 0
2 years ago
Other questions:
  • Excel 2016 is primarily what type of program?
    15·1 answer
  • ________ take computers with wireless connections through an area and search for unprotected wireless networks, and then monitor
    13·1 answer
  • Defining a(n) ______________ of an object is called instantiation.
    12·1 answer
  • Marissa, a 21-year-old young woman, is working as an intern at a software company. She has recently graduated from college. She
    6·1 answer
  • How to do this PLEASE HELP 80 points!
    15·1 answer
  • What is the multiple source test
    15·1 answer
  • Convert each number into scientific notation.
    6·1 answer
  • Tech A states that modern vehicles use asbestos as the brake material. Tech B states that asbestos is no longer used in brakes.
    8·1 answer
  • What is the difference between margin and padding property?
    7·1 answer
  • Using computers can lead to a number of physical safety issues. State and explain TWO(2) of these types of issues.​​​​​
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!