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

a ___ is a type of computer that is small and portable?

Answers

Answer:

laptop

Explanation:

laptops are small and they can be taken anywhere.

Which frequency will 802.11n work on if on a single-link network?

Answers

802.11n can function in "mixed mode" on the 2.4 GHz frequency, with a theoretical maximum speed of 300 Mbps, or on the 5 GHz frequency.

What do you mean by frequency?

In the case of electrical current, frequency is the number of times a sine wave repeats or completes, a positive-to-negative cycle.

802.11n can operate in "mixed mode" on the 2.4 GHz frequency, which will support just 802.11b or 802.11g-capable systems but will slow the entire network down to the maximum speed of the earliest standard connected, at a theoretical maximum speed of 300 Mbps.

Learn more about the single-link network:

https://brainly.com/question/4272298

#SPJ1

Q3: What do you mean by a pointer to a pointer? Can this be extended?

Answers

Answer:

hola, te habla mi contestadora si no te contesto seguro no quiero hablar con vos

donde vas si son las 11?

todo el barrio la conoce

Explanation:

le gusta sentirse mala, tiene un tubo en la Sala

para tumbar el club

kiere quedarse dentro del party

será cuestión de tiempo?

conosco tu debilidad

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.

You add a filter by condition, and set the condition to [Weight]>50. How will this affect your data? in tableau

Answers

It will only show items whose weight is over 50 is the  way it will this affect data. When the computed field is utilized in the filter, only items with a weight greater than 50 are kept.

How do the person filter by condition in Tableau?

There are five steps involved in it that are given below-

In the Filter Window, go to the 'Condition' tab.Select the 'By field' radio button.From the drop-down list, choose the name of the filtered field.Choose an aggregation type from the drop-down menu, such as Sum, Average, or Median.From the drop-down menu, select the operator.

Thus, It will only show items whose weight is over 50

For more details about person filter by condition in Tableau, click here:

https://brainly.com/question/25531734

#SPJ1

What’s the main purpose of a personality test?

Answers

Answer:

Which of following is not anelectroyte

Personality tests are designed to systematically elicit information about a person's motivations, preferences, interests, emotional make-up, and style of interacting with people and situations.

Why is it important not to leave your personal information on a public computer?
A. Other people need a clean computer to use.
B. Someone can steal the information and hurt you.
C. It makes it hard for the next person to log in.
D. It's rude and someone else has to clean up after you

Answers

Answer:

B. Someone can steal the information and hurt you.

Explanation:

People can hack into your accounts using your informations and spread hurtful things that can make people hurt. The people will think that you posted this (even if you didn't) and blame you.

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

I have a .NET 6 basic website that I built using Entity Framework as the database for updating pages. I am ready to deploy the site/database to a live server somewhere, but I am looking for the best option.

The website is built using the latest .NET Framework 6.0, with Entity Framework 6.0.3. I know about HostGator, GoDaddy and InterServer.

I have read stuff online that said HostGator doesn't actually support the latest .NET 6.0, and GoDaddy only supports .NET Core 3.2?

HostGator is rougly $5.00 a month, GoDaddy is $6.00, and InterServer is $8.00.

I am leaning towards InterServer, because I have read that InterServer supports the latest .NET 6.0 and Entity Framework.

I am used to deploying to servers using LAMP stack, Linux, Apache, PHP, MySQL... The prices there are lower and it is fairly simple to setup. I figure there has to be something similar for windows and .NET.

For something similar, am I looking for Shared Hosting? Or VPS? I really don't understand what I need. I was hoping for Shared Hosting, export my SQL Server database, create it on the live server, then FTP my files over.

InterServer seems like it supports everything, so I am leaning towards that. I know no matter what, Windows Hosting is going to be a little bit more expensive. I just want something that I know is going to work with the latest .NET technologies.

Does anyone have any suggestions?

Answers

In the above scenario, i will recommend Bluehost  or InterServer since it is good and can meet your requirement.

What is Bluehost?

Bluehost is known to be a software that is said to be a little bit better than HostGator in the aspect of  security as it gives offer free SSL certificates, malware tools, and others.

Therefore, In the above scenario, I will recommend Bluehost  or InterServer since it is good and can meet your requirement.

Learn more about Bluehost from

https://brainly.com/question/17062016

#SPJ1

Many physical features of CPUs have been upgraded over the years. Below are some the features that latest CPUs can perform. Briefly explain how each can benefit users of computers.
 64‐Bit processing.
 Virtualization support.

Answers

Answer:

64-Bit Processing - Faster processing times, faster loading times

Virtualization Support - Ability to run one OS (including its hardware) on another, different, OS (such as emulating AndroidOS on RaspberryPiOS)

To stay safe and avoid malware programs you should (choose 3)
a. run updates to your computers operating system
b. turn off your computer
c. install antivirus software and run regular updates and scans
d. click on any antivirus software ads that you see on the internet
d. avoid suspicious-looking ads or downloads when on the internet
f. install every virus software

Answers

Answer:

I would say choose,

A -  run updates to your computers operating system

C - install antivirus software and run regular updates and scans

D - avoid suspicious-looking ads or downloads when on the internet

of
tion
TCP/IP was developed in the 1960s to enable university scientists to locate other computers on the Internet.
Select one:
O True
O False

Answers

Answer:

True

Explanation:

Enter a formula in cell E4 to calculate how long each item has been on sale. This is calculated by subtracting the launch date in cell D4 from the Data Updated date in cell C20. To show the time in years, divide that result by 365. Use an absolute reference to the date in cell C20. Copy the formula from cell E4 to cells E5:E14.

Answers

The formula is given below:

(C20-E4)/365

where 365 is the no of the days.

In a spreadsheet application, an absolute cell reference is a cell reference that doesn't change even if the spreadsheet's size or shape changes, or if the reference is copied or relocated to a different cell or page. When making references to constant values in a spreadsheet, absolute cell references are crucial.

Learn more about cells here https://brainly.com/question/25879801

#SPJ10

Build python

Prompt the user for the length,width and height of a room.


Calculate the area of the floor. (length*width)


Calculate the volume of the room. (length*width*height)


Display the area and volume to the user.


Open a file named “roomdata.txt”.


Write the area and volume to the file.

Answers

Answer:

You'd have to create a "roomdata.txt" file before writing to it.

Explanation:

#Python Geometry

lenght = int(input("Enter lenght: "))

width = int(input("Enter width: "))

height = int(input("Enter height: "))

def floor_area(area);

area = 0

area = lenght * width

return area

def room_volume(vol);

vol = 0

vol = lenght * width * height

return vol

print ("Area of floor = ", floor_area, "/n Volume of room = ", room_volume)

f = open ("roomdata.text", "w")

f.write("Area of floor = ", floor_area, "/n Volume of room = ", room_volume)

f.close()

Demonstrate an understanding of the use of preventive procedures

Answers

Thre are 3 types of prevention Primary prevention, secondary invention, and tertiary invention.

What do you mean by prevention?

The process of stopping anything from happening by being prepared and getting rid of it quickly. prophylaxis. the control of illness. save.

Three different kinds of preventative initiatives:

Primary prevention entails taking action before negative health impacts arise.Screening to find diseases as soon as possible is secondary prevention.Managing disease after diagnosis in order to slow down or stop it is known as tertiary prevention.

Learn more about Preventive procedures:

https://brainly.com/question/7183215

#SPJ1

Give the value of the zero flag, the carry flag, the signflag, and the overflow flag after each of the following instructions if AX is initialized with 0x1254 and BX is initialize dwith 0x0FFF.

a. add ax, 0xEDAB

b. add ax, bx

c. add bx, 0xF001

Answers

The correct answer is A for this question

Add ax, 0xEDAB is the value of the zero flag, the carry flag, the sign flag, and the overflow flag after each of the following instructions if AX is initialized with 0x1254 and BX is initialize dwith 0x0FFF

What is sign flag?

Sign flag is defined as whether the outcome of an arithmetic operation is positive or negative is indicated by a bit in a status byte in the central processing unit of a computer. Architecture determines the size and significance of the flag bits. It often includes data regarding current constraints on CPU operation as well as the outcome of arithmetic operations.

After any operation, the sign flag (S) is set to 1, indicating that the number is negative, if the MSB (B(7)) of the result is 1. Zero Flag (Z): If the outcome of any mathematical or logical operation is 0 (00)H, the zero flag (Z) is set, or 1, otherwise it is reset, or 0.

Thus, add ax, 0xEDAB is the value of the zero flag, the carry flag, the sign flag, and the overflow flag after each of the following instructions if AX is initialized with 0x1254 and BX is initialize dwith 0x0FFF

To learn more about sign flag, refer to the link below:

https://brainly.com/question/12974452

#SPJ2

Which statement is true about the energy of electromagnetic radiation?

A.
The frequency of the emitted radiation is inversely proportional to its energy.
B.
The frequency of the emitted radiation is directly proportional to its energy.
C.
The wavelength of the emitted radiation is directly proportional to its energy.
D.
The amplitude of the emitted radiation is inversely proportional to its energy.

Answers

Answer:

b

Explanation:

b

How can MS Word aid healthcare professionals with virtual communication?

Answers

MS Word aid healthcare professionals with virtual communication by the Handled properly, phrase processing promises massive benefits: stepped forward collections, improved coins flow, decreased paperwork, and improved donations to healthcare foundations.

What do nurses use Microsoft Word for?

Personnel control data (demographic and expert information of nursing staff), Resource control/evaluation monitoring for reviews on budgeting DRGs, time beyond regulation usage, affected person care hours, deliver gadget projections, and staffing hours, and.

The Microsoft Office System, coupled with accessories supplied via way of means of partners, promises a portal answer that may offer clinicians and researchers immediate get admission to to the data they need, which includes the present-day scientific magazine articles, drug reference data and affected person handouts.

Read more about the word:

https://brainly.com/question/190029

#SPJ1

What would you consider before buying a printer​

Answers

Answer:

Printing Quality, Price, If it van vonnect to my laptop or nay devices.

Answer:

to make sure it comes with ink

Explanation:

if not buy some when u purchase it

What are the predominant means by which individuals enter the InfoSec profession?

Answers

InfoSec is a profession with little personnel turnover.

The network layer of the ISO/OSI model organize bits into ..........​

Answers

Answer:

frames

Explanation:

The data-link layer is the second layer from the bottom of the OSI Model. The data-link layer's principal role is to identify errors and merge data bits into frames.

how does the government us information system to manage traffic flow

Answers

the street lights have timers on them to change naturally, and the roads have wires underneath to feel when a car is waiting so when they feel there’s a lot of people they keep going and then time out and the other lanes get to go

True or false, cases must use curly braces like other test condition statements
A. true
B. false

Answers

Answer:

False

Explanation:

You can use curly braces to scope everything that's inside of the case body, but they are not necessary.

There are cases where you will need explicit bodies for cases:

If you have two different cases that both contain a variable called 'x', you will need to scope one or both of the cases.

What is scoping?

Scoping in a language defines where variables can be accessed, or referenced.

int i = 0;

// First scope

{

int x = i + 10;

}

// Second scope

{

int j = x + 2;

}

Console.WriteLine(j);

There are a few errors in this code.

In the second scope, we try to use the variable 'x' which was defined in the first scope, but we can't find that variable because it is defined in a scope that cannot be reached by the second scope. The same goes with the Console.WriteLine(j); line, we try to access a variable that is not defined in the current scope, and is instead defined in a nested scope.

In most languages, scoping is essentially a stack, where the lower nested scopes can access variables defined in the previous scope, but not the other way around.

So now you know a little bit about scopes; when to use them in case bodies, and that you do not have to use a body for a case if it's not necessary.

What federal law requires manufacturers to put care labels on their garments and fabrics sold by the yard?

Answers

CARE LABELING RULE which requires manufacturers and importers to attach care instructions to garments.

Create a defined name for range b6:e6 using walkup as the range name

Answers

In order to create a defined name for the range, one must follow the steps below.

What are the steps to creating a named range?

Step 1 - Select the concerned range (Rows and columns inclusive of the labels)Step 2 - From the Ribbon above, select Formulas. Then select "Create From Selection".From the "Create From Selection" dialogue box, select the option that is indicative of the location of your row / column.Click "Ok".

Learn more about Named Range at:
https://brainly.com/question/13396823
#SPJ1

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!

write an algorithm to find the area of a circle of radius r

Answers

Answer:

e=mc^2

Explanation:

Which for loop syntax is correct?
A. for {i=0, i<10, i++}
{code block}
B. for (i=0; i<10; i++);
{code block}
C. for (i=0; i<10; i++)
{code block}

Answers

Answer:

C

Explanation:

Why when I send a message on iOS it says the person’s notification is silenced, and the message isn’t delivered?

Answers

Answer:

This is because the other person has "Focus Mode" turned on. When this is turned on, all of your messages that you send to him/her will be silenced.

How to change the command prompt of a computer​

Answers

- Open the Terminal tab in the Command Prompt's Properties window.
- Next, in the Terminal Colors section, select the options you want to change
- You can also change the cursor type to Underscore, Vertical Bar, Empty Box, or Legacy Style.
Other Questions
Simplify the expression -17.8a-2.4a+25-19.5 Why are arthropodes the most diverse group How do development within each domain is linked to and affected by development in other domain. Which element does Peabody change most in heradaptation?the main characterthe genrethe primary settingthe plot What is the slope of the line that passes through the points (-7, -2)(7,2) and (-15, -14)(15,14)? Write your answer in simplest form. Meeting planners might find themselves doing all of the following except:1.arranging for technical and audiovisual needs2.establishing agenda, objectives, and budget3.establishing policies and programs for business travel4.working with vendors to secure locations X-6-103y-719-2What is the domain of the given function?O {x|x = -6, -1, 0, 3}(y ly=-7, -2, 1, 9}{x|x=-7, -6, -2, -1, 0, 1, 3, 9}(y ly=-7, -6, -2, -1, 0, 1, 3, 9}1 Salungguhitan nang minsan ang sugnay na makapag-iisa at nang dalawang ulit ang sugnay na di-makapag-iisa. My Friend always bit me what will I do D HELP PLEASE IT IS URGENT!!Why does the PPF bow outward?a) Because, while costs of sacrificedproduction may remain constant, thereare diminishing returns as moreresources that are freed-up may beless productive in the secondindustry.b) Because as more of one good isproduced, costs of sacrificedproduction may increase as resourcesbetter suited to production of thesacrificed good are freed-up toproduce the other product.c) Neither of the above.d) Both of the above. During Athens first democracy, the people? At a given temperature, lighter gas molecules:A) have an average speed less than heavier gas molecules. B) have an average speed greater than heavier gas molecules. C) ll move more slowly than heavier gas molecules. What was one restriction placed on free African-Americans? Why did the Black Death occur? the middle colonies were dutch territory that consisted of land between the north and south ____A. Mexican colonies B. English colonies C. Canadian colonies D. French colonies Please answer asap for brainlist Y-6.37x=-3 which of the following function notation corresponds to the equation below witch country was part of africa at one point in history1. Arabia 2. India3. Malaysia Read this passage. Then answer the question.A predator is an animal that hunts other animals for food. Predators often use camouflage to sneak up on their prey. _________, a screech owl has brown feathers that blend in with tree bark. The owl sits in the tree, watching for a mouse. The mouse cant see the owl against the tree barkuntil its too late!What linking word or phrase could be used in the blank in the paragraph? A. Finally B. To sum up C. In addition D. For instance Woodrow Wilsons progressive platform was known as the The first step of the financial evaluation process for capital budgeting is: