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
timofeeve [1]
3 years ago
14

This program will output a right triangle based on user specified height triangleHeight and symbol triangleChar. (1) The given p

rogram 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. (1 pt) (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. (2 pts) Example output for triangleChar = % and triangleHeight = 5: Enter a character: % Enter triangle height: 5 % % % % % % % % % % % % % % % LAB ACTIVITY 4.15.1: Ch 4 Warm up: Drawing a right triangle (C)
#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;
}
Computers and Technology
1 answer:
vesna_86 [32]3 years ago
5 0

Answer:

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

   int i, j;

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

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

           printf("%c ", triangleChar);

       }

       printf("\n");

   }

   return 0;

}

Explanation:

  • Get the character and height as an input from user.
  • Run the outer loop up to the height of triangle.
  • Run the inner loop up to the value of i variable and then display the character inside this loop.
You might be interested in
Sftp uses which mechanism to provide security for authentication and data transfer?
12345 [234]

Sftp uses SSH mechanism to provide security for authentication and data transfer.

<h3>What are SSH known for?</h3>

SSH or Secure Shell is known to be a kind of a network communication protocol that helps two computers to be able to communicate and also  share their data.

Therefore, one can say that Sftp uses SSH mechanism to provide security for authentication and data transfer.

Learn more about  SSH mechanism from

brainly.com/question/13086077

#SPJ12

3 0
2 years ago
Distinguish between principles, guidelines and standards, using examples of each to illustrate​
AleksAgata [21]

Explanation:

principles is what governs a place

guidelines is what you read to guide you

standards is what build up in your self

5 0
3 years ago
Read 2 more answers
Outlook 2016 is not only an email client, but it can also be used to schedule meetings and
klio [65]

Answer:

Outlook 2016 is not only an email client, but it can also be used to schedule meetings and <u>Manage appointments</u>.

Explanation:

Microsoft Outlook is a tool that is used to send and receive emails. In outlook 2016 version it has many other advantages such as:

  1. Managing Contact Directory
  2. Managing Address Books
  3. Scheduling Meetings
  4. Managing Appointments
5 0
4 years ago
Read 2 more answers
Can someone help me on drawing ER and Use case diagram on following scenarios. ASAP!!! Please :(
GalinKa [24]

Answer:

The ER Diagram is in the attachment. And I an including the membership details in the use case:

Applicants: Coach will ask for iD.

if the application is not registered, coach sends to registration department.

Applicants registers-->> shows registration ID-->> goes to account section

Submits the fee->> goes to coach again-->>coach asks for fee sjip-->> On yes-->> entrance allowed else-->> sent to account section

Applicants apply for course-->>if prerequisite is met, registration allowed

else-->>registration denied

Note: If registration is allowed the applicant is sent to account section and

Also note:

First check, then registration, then course prerequisite check,then account->entrance

If registered->direct entry.

Explanation:

The answer is self explanatory.

4 0
4 years ago
How does a spreadsheet affect the column of numerals when it sorts the column
Setler [38]

You have several options when you want to enter data manually in excel. Data can be put into more than one cell, which should be an important key to your answer. In <u>SEVERAL CELLS AT THE SAME TIME</u> or more. The data can be entered in dates, text, times, or numbers. Fortmatting the data can be done in a possibility of ways. Therefore, several settings is what you can adjust.

6 0
3 years ago
Read 2 more answers
Other questions:
  • Why people needs soft skills in the era of high technology.
    13·1 answer
  • Which is the most important reason you should properly cite information that you obtain from an Internet search? Question 2 opti
    8·1 answer
  • Which of the following is a reason photographing animals can be difficult?
    9·2 answers
  • A common approach of networking multiple computers as opposed to a single computer is? called:
    14·1 answer
  • to minimize wrist injury switch frequently among touch gestures the keyboard and the mouse true or false
    15·1 answer
  • Which of the following protects intellectual property?copyright
    9·2 answers
  • g Given the information below, answer each part of the question: Page Size: 4 KB a. How many bits are in the Page Offset
    11·1 answer
  • Which of the following statements best describes the relative amount of content held by digital libraries vs. the amount held by
    15·1 answer
  • Select the best answer from the drop-down menu.
    14·2 answers
  • 2. 25 POINTS!!!!!!!!!
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!