Home  |  IT Zone  |  Tips / Tricks  |  Did You Know  |  Inspirational  |  Health  |  World Infos  |  Insurance  |  Universities  |  Forex  |  Mathematics  |  Illusions  |  Children Day Quotes  |  Fun / Jokes  |  Decent Quotes  |  Birthday Msgs  |  Good Morning Msgs  |  Good Night Msg  |  Husband Wife Jokes  |  Teacher Students Jokes  |  Insult Jokes  |  Love Quotes  |  Sad Quotes  |  Funny Pics  |  Be Aware  |  Articles  |  Simple Joys of Life 

Program to classify the type of triangles. (i.e. equilateral, isosceles, or scalene).

Program to classify the type of triangles. (i.e. equilateral, isosceles, or scalene).  (Qbasic Code)

CLS
top:
INPUT "Enter the length of the first side of triangle"; a
INPUT "Enter the length of the second side of triangle"; b
INPUT "Enter the length of the third side of triangle"; c
IF a + b < c OR b + c < a OR c + a < b THEN
    PRINT "Triangle can not be formed"
    GOTO 1:
ELSEIF a = b AND b = c AND c = a THEN
    PRINT "Equilateral Triangle"
ELSEIF a = b OR b = c OR c = a THEN
    PRINT "Isosceles Triangle"
ELSE
    PRINT "Scalene Triangle"
END IF
1:
PRINT
INPUT "Do you want to check more (Y/N)?"; ans$
IF UCASE$(ans$) = "Y" THEN
    GOTO top:
ELSE
    SYSTEM
END IF
END

Share :

Twitter
Back To Top

facebook main

Powered by Blogger.