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;

}

Answers

Answer 1

The program illustrates the use of loops;

Loops are program statements that are used to perform repetition

The complete program

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:https://brainly.com/question/24833629

#SPJ1


Related Questions

In what ways may the WBS be used as a key document to monitor and control a project?

Answers

By bringing everyone's attention to the work that has to be done, WBS can be utilized to prevent scope creep.

What is WBS?

WBS stands for Work Breakdown Structure. It facilitates task allocation. It is much simpler to allocate work to the proper person when a project is divided into manageable tasks or packages. This assists your team in making plans for tasks that must be accomplished in addition to the job at hand.

Thus, the WBS can be used as a key document to monitor and control a project because it makes the process of quickly creating a timetable easier, By assigning work estimates to particular WBS parts, the required task is described and organized by it.

Learn more about WBS here:

https://brainly.com/question/13090633

#SPJ1

Which benefit does serverless compute provide?

Answers

Answer: this’s an architecture where code execution is fully managed by a cloud provider, instead of the traditional method of developing applications and deploying them on servers

What is the difference between a status bar, title bar, and tabs?

Answers

Answer:

Status Bar: a horizontal window at the bottom of a parent window in which an application can display various kinds of status information. The status bar can be divided into parts to display more than one type of information. The following screen shot shows the status bar in the Microsoft Windows Paint application.

Title Bar: horizontal bar at the top of a window, bearing the name of the program and typically the name of the currently active document.

Tabs: a tab is a clickable area at the top of a window that shows another page or area

**HELP ME PLS**

A report tried "Employees in Company A contains the names of employees in descending alphabetical order, with the
number of years each employee worked at the company. Which statement is true? A.The report is grouped only because it gives information about employees by number of years of employment.

B.The report is soned only because it gives information about employees by number of years of employment.

C.The report is grouped only because it organizes the names of the employees in alphabetical order.

D.The report is sorted only because it organizes the names of the employees in alphabetical order.

Answers

The true statement is the report is grouped only because it gives information about employees by number of years of employment.

What is a group report?

Group reporting is made up of consolidation method and analytical reports and it gives information on the output of a firm.

Note that since there are different ranges of employment years, the report need to be grouped and as such, The true statement is the report is grouped only because it gives information about employees by number of years of employment.

Learn more about group report from

https://brainly.com/question/13628349

#SPJ1

importance of software in computer​

Answers

Answer:

It allows accomplishing functions using the computer. The software is the instruction we want the computer to process for us.

Explanation:

I want to type a letter. I need a software that can interpret my letters in the keyboard and the program can print what I am typing.

E. Write an algorithm to show 'How to prepare a cucumber sandwich?". ​

Answers

Answer:

Place slices of bread on plate, side by side...

Postcondition: Sandwich is ready to eat.

Step 1: Start with the number 1.

Step 2: find another person and form a pair.

Step 3: add your numbers together.

Step 4: one person from the pair sits down.

Step 5: the other person goes back to step 2.

Give an implementation of the abstract data type of a priority queue of integers as an
ordered list using the SML syntax (ML functor). Given the following:

type Item
val > : Item * Item -> bool

Answers

We can use the code for IntPQ to implement the priority queue construction:

functor PQUEUE(type Item  

              val > : Item * Item -> bool  

             ):QueueSig =  

struct  

   type Item = Item  

   exception Deq  

   fun insert e [ ] = [e]:Item list  

     | insert e (h :: t) =  

       if e > h then e :: h :: t  

                else h :: insert e t  

   abstype Queue = Q of Item list  

   with  

       val empty          = Q []  

       fun isEmpty (Q []) = true  

         | isEmpty _      = false  

       fun enq(Q q, e)    = Q(insert e q)  

       fun deq(Q(h :: t)) = (Q t, h)  

         | deq _          = raise Deq  

   end  

end;

What is SML?

The capital asset pricing model (CAPM), which displays varying levels of systematic, or market risk, of various marketable securities plotted against the projected return of the entire market at any one time, is represented graphically by the security market line (SML), a line drawn on a chart.

The supplied predicate, which we consider to be a total ordering, can be used as the priority order in a priority queue. The end result is a structure with a new type for the queue and a number of operations that work with it. We create a new structure from a group of types and values (a structure), and we represent this creation as an ML functor. A functor takes a structure and produces a new structure, much as how a function takes a value and makes a new value. To accomplish the formation of the priority queue, we can utilize the IntPQ code.

Learn more about SML here https://brainly.com/question/15901527

#SPJ10

Can case conditions use test conditions?
A. yes
B. no

Answers

Answer:

yes.

Explanation:

because i Been tro it before

When should students in a study session use flash cards to quiz one another?

while reviewing
while drilling
while discussing
while preparing`

Answers

When drilling, students in a study session use flashcards to quiz one another. thus, Option B is the correct statement.

What do you mean by drill and practice?

The term drill and practice can be described as a way of practice characterized by systematic repetition of concepts, examples, and exercise problems.

Drill and exercise is a disciplined and repetitious exercise, used as an average of coaching and perfecting an ability or procedure.

Thus, When drilling, students in a study session use flashcards to quiz one another. Option B is the correct statement.

Learn more about drill and practice:

https://brainly.com/question/27587324

#SPJ1

HELP QUICK!!!!!!!

Which item is used in Excel to identify the row of a particular cell?
O letter
O number
O type
O sheet

Answers

Answer:

Number.

Letter is for columns, Number is for rows.

For example to find the cell on the fifth row, and 1st column, it would be A5.

List and describe four services that comprise IT infrastructure, beyond physical devices and software applications.

Answers

The four services that comprise IT infrastructure are:

Telecommunications services. Data management services . Application software services.Physical facilities management services.

What does these services do?

Telecommunications services is known to help in terms of giving data, voice, and video network.

Data management services helps to save , manage, and analyze all data. Application software services helps to give firms-wide range capabilities.

The Physical facilities management services helps to make and handle physical installations of technology.

Therefore, The four services that comprise IT infrastructure are:

Telecommunications services. Data management services . Application software services.Physical facilities management services.

Learn more about  IT infrastructure from

https://brainly.com/question/869476

#SPJ1

What is spy wear on a desk top computer

Answers

Answer:

Spyware is when a hacker gathers confidential information and data by logging the user's key presses (keylogging) etc and uses it for fraud or identity theft. That's also why touchscreens are safer than keyboards.

Explanation:

what are the importance of computer software​

Answers

Answer:

It controls and coordinates all hardware and software functions within your PC. It is designed to be ever-improving so that newer tasks are performed more efficiently.

Software not only makes your computer hardware perform important tasks, but can also help your business work more efficiently. The right software can even lead to new ways of working. It is therefore a crucial business asset and you should choose your software carefully so that it matches your business needs.

What should the Dhruv consider when connecting to the Internet in a public place? Select all that apply.

Answers

Dhruv should be more careful while using internet in a public place

Q For each of the following words identify the byte that isstored at lower memory address and the byte that is stored athigher memory address in a little endian computer.
a. 1234
b. ABFC
c. B100
d. B800

Answers

C is the correct answer for this question

in tabular form differentiate the first four generations of computer ​

Answers

Answer:

Explanation:

See attachment.

Software that functions as an electronic version of a filing cabinet?

Answers

Answer: There are a lot of choices

Explanation: do you want a database? You can obtain a terabyte or even larger size thumb drive or USB drive

Do want a print server? a networked drive specific for your data and if you have  to   print out anything

Do you want a connected drive to send all your documents to with organized folders?  any size drive will work for this they come all prices

Enter the electronic filing system, sometimes called document management software. These computerized filing systems provide electronic file management. In other words, they give us a simple way to store, organize, and retrieve digital files and digital documents and pdfs.

https://www.filecenter.com/info-electronic-filing-system.html here is some good software

Which of the following keys on the keyboard is used to quickly indent text

Answers

you have to use tab on the keyboard

The formula for calculating the amount of interest charged on a loan is:

interest = [principal x rate] of interest x time

Which Python statement correctly performs the interest calculation?

Answers

The Python statement that correctly performs the interest calculation is:

interest = (principal interest) time.

What is a Python statement?

This is known to be a statement  that is said to an instruction that a Python is said to often decode or interpreter and it is also one that it can execute.

Therefore, The Python statement that correctly performs the interest calculation is:

interest = (principal interest) time.

Learn more about Python statement from

https://brainly.com/question/14986545

#SPJ1

write an alogorithm and draw the Flow Chart to
Find the Rost or quardratic equation.
2
ax² + 3x + C = 0
the Coefficont abc
are the input data
the Coefficent d is the Output data.

Answers

In computer programs, algorithms and flowcharts are used as prototypes of an actual program

The algorithm

The algorithm of the program is as follows:

Input a, b, cCalculate d using d = b*b - 4 * a * cIf d < 0, print "Complex roots"ElseCalculate x₁ using x₁ = (-b + sqrt(d))/4 * a * c)Calculate x₂ using x₂ = (-b - sqrt(d))/4 * a * c)Print x₁ and x₂End

The flowchart

This is always in represented using a diagram

See attachment for the flowchart.

Read more about flowchart and algorithms at:

https://brainly.com/question/16763367

#SPJ1

43
What are several examples of fictional photography?
O A
celebrity, fashion, glamour
OB.
nature, sports, life
OC. military, propaganda, commercial
OD. corporate, scientific, police
Reset
Next

Answers

Answer:

c

Explanation:

I think A for sure it shows everything I could think of in fictional photography

What is software engineering? What are the objectives of software engineering?

Answers

Answer:

The basic objective of software engineering is to develop methods and procedures for software development that can scale up for large systems and that can be used consistently to produce high-quality software at low cost and with a small cycle of time.

Explanation:

Pls guys I need help fast my PC is new and it can't connect to a network

Answers

Answer:

There are several reasons why your PC might not be able to connect to Wi-Fi. You should first make sure that your PC's Wi-Fi adapter hasn't been turned off, or needs to be reset. The issue might also be with the Wi-Fi, not your PC — make sure that it works on other devices.

Answer:

Use ethernet cable, it worked for me!

compare the results of both the RATS and Skipfish reports.

Answers

Answer:

The results of both reports RATS is known nas mouse and skipfish is known as one type of fish

what are differences between Ram and Rom?​

Answers

Answer:

RAM, which stands for random access memory, and ROM, which stands for read-only memory, are both present in your computer. RAM is volatile memory that temporarily stores the files you are working on. ROM is non-volatile memory that permanently stores instructions for your computer.

Explanation:

Answer:

RAM is random access memory - we can have it even after we shut down the computer. it is volatile .it stores temporarily.

ROM - Read only memory. it is non volatile memory. we can only have it until computer is turn on. after that it's gone.it stores memory permanently

Two negative reviews and no positive reviews is enough to consider the website to have a negative reputation.

Answers

Two negative reviews and no positive reviews is enough to consider the website to have a negative reputation: False.

What is reputation?

In Computer technology, reputation can be defined as a metric which is used to determine the quality of a particular website, especially based on the opinions and ratings by its end users.

In this context, we can infer that two negative reviews and no positive reviews isn't an enough metric to consider a website as having a negative reputation.

Read more on negative reputation here: https://brainly.com/question/2343924

#SPJ1

How ict tools changed the way we live explain it​

Answers

Answer:

How does ICT change our way of living?

ICT has contributed a lot to change our everyday life such as letter to e-mail, market shopping to on-line shopping, classroom learning to e-learning, etc. This paper present's the effects of ICT as Home and Domestic Activities, Social Networking, Education, Health, Commerce, Banking, and Employment.

what is the function of computer?​

Answers

[tex]\huge\purple{Hi!}[/tex]

the four basic function of a computer are input, storage, processing and output.

The classes Person and Airplane shall have the property to print information about themselves on a printer. Draw class and interaction diagrams

Answers

The classes Person and Airplane shall have the property to print information about themselves on a printer the . Interaction diagrams cognizance on describing the waft of messages inside a device, imparting context for one or greater lifelines inside a device.

How do you operate interplay diagrams whilst you version dynamic factors of a device provide an explanation for with an instance?

Purpose of Interaction Diagrams. Sequence and collaboration diagrams are used to seize the dynamic nature however from an exceptional angle. To seize the dynamic behavior of a device. To describe the message waft withinside the device. To describe the structural corporation of the items.

Interaction diagrams are that describe how a collection of items collaborate in a few conduct - generally a single use-case. The diagrams display some of instance items and the messages which can be handed among those items in the use-case. its call would possibly suggest, an interplay diagram is a sort of UML diagram it's used to seize the interactive conduct of a device. Interaction diagrams cognizance on describing the waft of messages inside a device, imparting context for one or greater lifelines inside a device.

Read more about the interaction diagrams:

https://brainly.com/question/19632962

#SPJ1

What type of software can Agile and DevOps be applied

Answers

Answer:

STATA AND SPSS

Explanation:

these are mostly widely used statistical package in modern statistical calculations. it is minimizes times and as well as resources.

Other Questions
Using the conclusion from ruthefords model, identify a charged subatomic particle that is located in the nucleus Explain the wife's inductive reasoning for determining her husband's level of safety at work pls help answer ASAP Professionals who leverage emotional intelligence in their day-to-day interactions have a natural ability to mobilize teams while neutralizing toxic people. Explain in your own words how elements of emotional intelligence serve each of these outcomes. A 545 N sled is pulled a distance of 385 m. The task is done by pulling on a rope with a force of 1225 N at an angle of 19 with the horizontal. How much work is done in pulling the sled? What is the acceleration in the x direction, assuming that friction is negligible? Assuming the sled started at rest, how long does it take to pull the sled 185 m? As you are working with a pivot table, you decide to change some of your source data. How will the pivot table recognize the change?. what causes dominant traits to be dominant? which one is the correct graphGraph f(x) = -1/2xClick on the graph until the graph of f(x) = -1/2x appears PLS HELP!!! 50 POINTS!!!Part C: In the section describing the survey methods, the report states, Each sample of national adults includes a minimum quota of 60% cell phone respondents and 40% landline respondents. Do you think this is a good minimum quota for this survey? Should it be lower or higher?Part D: The report begins by showing three bulleted highlights from the survey. At the end of the article, you can click a link to view the complete question responses and trends. Click the link and interpret the results of question 5. Use your interpretation of the statistics to write one more bullet point that could be added as a fourth bullet at the beginning of the report. If the property remains listed for more than 30 days with no potential buyers, what does the agent need to complete? spanish quetions for people to help me with.. What does viscosity describe Which is the graph of the system x + 3y > 3 and y < One-halfx + 1? 10. (06.01 MC) Classify the expression: 5x3 + 2x 3 (1 point)Quadratic expressionLinear expressionCubic expressionExponential expression Show work, can someone help me out having trouble with this problem Find the midpoint of the segment with the following endpoints. (10, 6) and (4, 9) find y please help meeee :) If you are to comply with Medicares guidance regarding educational events, which of the following would be acceptable activities? The unit rate of change of yyy with respect to xxx is the amount yyy changes for a change of one unit in xxx.Is the unit rate of change of yyy with respect to xxx less in the equation y=6.5xy=6.5xy, equals, 6, point, 5, x or in the graph below? Which inequality is equivalent to 3+4/x>_x+2/x