Hello guys, I am very needy please help me out. Write the QBASIC program to get the square root of a number using DO WHILE…loop
Answers
Answered by
0
Language:
QBasic
Program:
INPUT "Enter a number: " ; a
PRINT a^0.5
Output:
Enter a number: 4
2
Explanation:
- INPUT: accepts a number and saves it in a variable a.
- a^b: will raise a to the power of b. Since the power for square root is 1/2 = 0.5. Use a^0.5 to get to your desired ouput.
Similar questions