Ask Question
25 January, 04:18

Write a Qbasic program to read the value of base and height of a triangle and find its area.

+2
Answers (1)
  1. 25 January, 06:55
    0
    The program to this question as follows:

    Program:

    PRINT "Program: Area of Triangle" 'print message

    INPUT "Enter base: ", base 'defining the variable base and input value from the user

    INPUT "Enter height:", height 'defining variable height and input a value from user

    Area=base*height/2 'formula to calculate Area

    PRINT "Area of Triangle:", Area 'print Area

    Output:

    Program: Area of Triangle

    Enter base: 2

    Enter height: 3

    Area of Triangle: 3

    Explanation:

    In the above Qbasic program, first, a print function is used to print the message. In the next line, the input function is defined, which uses the "base and height" variable for user input.

    Then another variable "Area" is defined that uses user input values to calculate the area of a triangle, and also store its calculated value. At the last, the print function is used to print Area variable value
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Write a Qbasic program to read the value of base and height of a triangle and find its area. ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers