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 find the surface area of a sphere. (Qbasic Code)

  • To find the surface area of a sphere. (Qbasic Code)
CLS
INPUT "Enter radius of sphere"; r
LET pie = 3.14
A = 4 * pie * r ^ 2
PRINT "The total surface area of the sphere is"; A
END


  • Using SUB Procedure
DECLARE SUB TSA (r)
CLS
INPUT "Enter radius of the sphere"; r
CALL tsa(r)
END

SUB tsa (r)
LET pie = 3.14
A = 4 * pie * r ^ 2
PRINT "The total surface area of the sphere is"; A
END SUB


  • Using FUNCTION Procedure
DECLARE FUNCTION TSA (r)
CLS
INPUT "Enter radius of the sphere"; r
PRINT "The total surface area of the sphere is"; TSA(r)
END

FUNCTION TSA (r)
LET pie = 3.14
A = 4 * pie * r ^ 2
TSA = A
END FUNCTION

Share :

Twitter
Back To Top

facebook main

Powered by Blogger.