Qbasic program to find square root of a number
CLS
INPUT “ENTER ANY NUMBER”; N
S = N ^ (1 / 2)
PRINT “SQUARE ROOT OF NUMBER ”; S
END
USING SUB
DECLARE SUB SQUAREROOT(N)
CLS
INPUT “ENTER ANY NUMBER”; N
CALL SQUAREROOT(N)
END
SUB SQUAREROOT(N)
S = N ^ (1 / 2)
PRINT “SQUARE ROOT OF NUMBER ”; S
END SUB
0 Comments