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
How can learning opportunities for AI be extended to all
statuscvo [17]

Answer:

Learning opportunities for AI can be extended to all through the inclussion of courses and different teaching methods related to Artificial Intelligence, new technologies, computer science, programming and, in short, everything related to the digital world, in the educational plans at the national level. This is so because artificial intelligence and computer systems are the basis for the development of the new tools jobs of tomorrow. Thus, education in these subjects is essential so that citizens can enter the labor market once they acquire the necessary age, having the knowledge to do so in a proper way.

6 0
3 years ago
A hockey stick hits a puck on the ice. identify an action-reaction pair in this situation.
Alika [10]
The stick exerts a force on the puck; the puck exerts a force on the stick.
7 0
3 years ago
Given below is information about a network. Choose one of the following three​ options: the network is definitely a​ tree; the n
MatroZZZ [7]

A Network is definitely a Tree when any of the below properties matched.

Explanation:

A Network is synonym for connected graph. Connected graph is a graph is a path which will connect from vertex to vertex.

A Tree is a network that has no circuit. network can be differed from tree by three key properties

1. Single path property - one path connecting two vertices

2. All bridges property - every edge of a network is a bridge

3. N-1 edges property - N vertices has N-1 edges

To determine this we use to N-1 edges property as given number of vertices and no bridges.

If a network has 15 vertices it must have 15-1= 14 edges to become a tree

4 0
3 years ago
You have important data on your hard drive that is not backed up and your Windows installation is so corrupted you know that you
love history [14]

Answer:

Make every attempt to recover the data

Explanation:

If your decide to format the drive, use system restore or reinstall the windows OS you may end up loosing all your data so the best option is to try as much as you can attempting to recover the data because the data might or definitely will be lost while using other options you think are available.

8 0
3 years ago
9) If you are working on the part of 5-15 minutes, time-stamping (every 30 seconds) should start at: a) [00:05:00] b) [00:00:00]
loris [4]

Answer:

a) [00:05:00]

Explanation:

Timestamps are markers in a transcript which are used to represent when an event took place. Timestamps are in the format [HH:MM:SS] where HH is used to represent hour, MM to represent the minute and SS to represent the seconds. They are different types of timestamping such as:

i) Periodic time stamps: Occurs at a consistent frequency

ii) Paragraph time stamping: At the beginning of paragraphs

iii) Sentence time stamp: at the beginning of sentence

iv) Speaker time stamp: at change of speaker.

Since a part of 5-15 minutes with time-stamping (every 30 seconds), The time stamping should start at 5 minute [00:05:00] and end at [00:15:00]. This is a periodic time stamp since it occurs every 30 seconds, this means the next time stamp would be [00:05:30] and this continues until 15 minute [00:15:00]

3 0
3 years ago
Other questions:
  • What were precomputed tables and why were they necessary?​
    12·2 answers
  • Once I install my secondary hard drive what two tasks need to be done?
    13·1 answer
  • Understanding the link between education and your desired career is an integral part of your career _______.
    7·2 answers
  • The File method lastModified() returns
    10·1 answer
  • Claire writes a letter to her grandmother, in which she describes an amusement park she visited last week. She adds pictures of
    13·1 answer
  • 2 ways to make your computer work faster ( please help asap )
    6·1 answer
  • Running the Disk Cleanup utility is a quick way to ________. Group of answer choices defrag your hard drive remove spyware progr
    10·1 answer
  • WHY DO YOU DElete EVERY QUESTIONS THAT IS ASKED! Im a freaking guy, yes and i wont followers for my channel so leave me alone!
    7·2 answers
  • How do we “read” and “write” in MAR and MDR memory unit, please help I am very confused :)
    10·1 answer
  • Which description best applies to a macro?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!