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 

To input radius of a circle and allows user to choose to find the area or perimeter of the circle. (Qbasic Code)

To input radius of a circle and allows user to choose to find the area or perimeter of the circle. (Qbasic Code)
  • CLS
    INPUT "Enter the radius of the circle"; r
    PRINT
    PRINT "To find the area, Press 1"
    PRINT "To find the perimeter, Press 2"
    PRINT
    INPUT "Which do you want to find"; ch
    PRINT
    pi = 3.14
    IF ch = 1 THEN
        a = pi * r ^ 2
        PRINT "Area of the circle is"; a
    ELSEIF ch = 2 THEN
        p = 2 * pi * r
        PRINT "Perimeter of the circle is"; p
    ELSE
        PRINT "Selection Wrong";
    END IF
    END

Share :

Twitter
Back To Top

facebook main

Powered by Blogger.