Natural number

  • Thread starter teng125
  • Start date
  • #1
416
0
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

thanx
 

Answers and Replies

  • #2
0rthodontist
Science Advisor
1,230
0
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
 
  • #3
416
0
what can i write for sqrt(i) in the pseudo code for pascal??

is it just sqrt(i) or any others??
 

Related Threads on Natural number

  • Last Post
Replies
17
Views
1K
  • Last Post
Replies
1
Views
1K
  • Last Post
Replies
3
Views
878
  • Last Post
Replies
0
Views
5K
  • Last Post
Replies
4
Views
4K
Replies
1
Views
3K
Replies
7
Views
2K
  • Last Post
Replies
8
Views
2K
  • Last Post
Replies
5
Views
1K
  • Last Post
Replies
0
Views
2K
Top