Write a Qbasic program to input a number to find its square root
Answers
Answered by
0
Program to find the square root:
CLS
INPUT “ENTER A NUMBER = ”; N
S = N ^ (1 / 2)
PRINT “SQUARE ROOT OF NUMBER IS ”; S
END
Answered by
0
Qbasic program to input a number to find its square root
Explanation:
CLS
INPUT “ENTER A NUMBER = ”; ip
S = ip ^ (1 / 2)
PRINT “SQUARE ROOT OF NUMBER IS ”; S
END
Here
In Qbasic
As usual the strings are surrounded with quotes
Every time we write a rogram we have to initiate CLS first
Next ,
We take input using
INPUT method
And we print the square root using PRINT method
To find square root we
Calculate input power half
As it indicates square root .
Similar questions