1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Natural number

  1. Aug 13, 2006 #1
    Consider the square root operation. Suppose an integer numbers i > 0 as input variable.
    Design an algorithm which calculates the greatest natural number less than or equal to
    the square root of the input variable i.

    can smby pls explain to me what does this ques mean??if possible explain using some example

  2. jcsd
  3. Aug 13, 2006 #2


    User Avatar
    Science Advisor

    A natural number just means a positive integer, like 1, 2, 3, 4, 5.

    Here are some examples of what your algorithm should do:
    sqrt(1) = 1
    sqrt(2) = 1
    sqrt(3) = 1
    sqrt(4) = 2
    sqrt(5) = 2
    sqrt(57) = 7
    sqrt(170) = 13
  4. Aug 13, 2006 #3
    what can i write for sqrt(i) in the pseudo code for pascal??

    is it just sqrt(i) or any others??
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Similar Discussions: Natural number