Ask Question
24 July, 18:48

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

+1
Answers (1)
  1. 24 July, 22:40
    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?
Find 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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers