Wednesday, October 16, 2019

6. Qbasic Program to ind square root of a given number

6.      Write a program in QBASIC to find square root of a given number using SUB…..END SUB.

DECLARE SUB SQROOT (N)
CLS
INPUT “ENTER ANY NUMBER”; N
CALL SQROOT (N)
END

SUB SQROOT (N)
S = N ^ (1 / 2)
PRINT “SQUARE ROOT OF NUMBER “; S
             END SUB

No comments:

Post a Comment