HomeExam Question Papers - (Class-10, Class-9, Class-8, Class-7, Class-6, Class-5, Class-4Class-3Class-2Class-1, Class-S.K.G., Class-J.K.G., Class-Nursery)

A program to check a triangle whether it is right angled or not when sides are given. (Qbasic Code)

REM A program to check a triangle whether it is right angled or not when sides are given. (Qbasic Code)

INPUT "Enter the longest side of triangle"; h
INPUT "Enter second side of triangle"; p
INPUT "Enter third side of triangle"; b
IF h ^ 2 = p ^ 2 + b ^ 2 THEN
    PRINT "The triangle is right-angled."
ELSE
    PRINT "The triangle is not right angled."
END IF
END

Share :

Facebook x
Back To Top

facebook

Powered by Blogger.