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 

Example (constant and variable)

A program to find the circumference of a circle. (Qbasic code)
CLS
INPUT "Enter the radius of circle"; r
pi = 3.14
c = 2 * pi * r
PRINT "The circumference of the circle is "; c
END

  • In the given program,
    • the value of  'r' is not fixed. Its value can be changed according to the user. So, 'r' is variable.
    • the value of 'pi' is already given so its value is fixed. And it remains same in the entire program. So, 'pi' is constant.

Share :

Twitter
Back To Top

facebook main

Powered by Blogger.