Page not loading? Try clicking here.
Placeholder

#129
Language restricted

While - Formative Assessment 5 1s - MB

Problems

Write a program that inputs the length of the base and height of a triangle, outputs the area, and inputs a single character from "Continue?" and repeats the task if the character is 'Y' or 'y', and terminates if the character is any other character.

(The area is rounded and printed to the first decimal place.)


Input

Prints "Base = " and receives the length of the base of the triangle.

Prints "Height = " and receives the height of the triangle.

Print the area of the triangle with "Triangle width = ", then on the next line print "Continue? " and ask the user to enter a single character to answer the question asking whether to continue.


Example

Base = 11
Height = 5
Triangle width = 27.5
Continue? Y
Base = 10
Height = 10
Triangle width = 50.0
Continue? N

Source

자기주도C언어프로그래밍

You must sign in to write code.