1

Also only use the loop while and if else statement to determine whether an integer is perfect square.

Adrian McCarthy
  • 45,555
  • 16
  • 123
  • 175
symta
  • 15
  • 4
  • The question is definitely a dupe, but i'd imagine it's h/w, to be honest i'd use brute force so it's not uber blatant that it's been copied. – George Oct 27 '16 at 16:05

1 Answers1

0

A perfect square is an integer multiplied by itself, so the most naive method would be to just loop from 0 to that to-be-checked number and see if the current loop variable multiplied by itself ever matches that to-be-checked number. There are a lot of optimization points but I left that out for you.

LeleDumbo
  • 9,192
  • 4
  • 24
  • 38