Ask the user to input a number. Check whether the entered number is a perfect square. I tried. enter image description here
Asked
Active
Viewed 1,276 times
-2
-
This sounds like a homework problem. Is it? – Tamar E. Granor Jan 22 '16 at 21:38
-
Yes. I tried it. It is issuing a nesting error – Ashutosh Kumar Jan 25 '16 at 15:22
-
The rules for this site say: "Questions asking for homework help must include a summary of the work you've done so far to solve the problem, and a description of the difficulty you are having solving it." – Tamar E. Granor Jan 25 '16 at 22:10
1 Answers
2
local num, nSqrt
Input "Enter a number" to num
IF m.num > 0
nSqrt = SQRT(m.num)
IF m.nSqrt == INT(m.nSqrt)
? LTRIM(STR(m.num)) + ' is a perfect square'
ENDIF
endif

Cetin Basoz
- 22,495
- 3
- 31
- 39