Binod Thakur
Binod Thakur

Reputation: 53

What is use of exclamation mark(!) in this qbasic programming?

DECLARE SUB cube(!)
INPUT "Enter  a length";l
CALL cube(l)
END
SUB cube(l)
area=6*l^2
PRINT "Area of a cube",area
END SUB

Upvotes: 0

Views: 880

Answers (1)

eoredson
eoredson

Reputation: 1165

This snip describes calling a subroutine in QBasic to get the area of a cube:

DECLARE SUB Cube(L!)
INPUT "Enter a length"; L!
CALL Cube(L!)
END

SUB Cube (L!)
Area! = 6 * L! ^ 2
PRINT "Area of a cube"; Area!
END SUB

The ! declares a variable as single precision.

Upvotes: 2

Related Questions