Skip to content
CampusEduX

Square Root Using Binary Search

Easyjavapythonccppjavascript

Given a non-negative integer N, find the integer part of its square root without using a built-in square-root function.

Input Format

A single line containing the integer N.

Output Format

Print floor(sqrt(N)).

Related Problems

  • Linear Search
    Easy · java, python, c, cpp, javascript
    Solve Problem
  • Binary Search
    Easy · java, python, c, cpp, javascript
    Solve Problem
  • First Occurrence in Sorted Array
    Easy · java, python, c, cpp, javascript
    Solve Problem

Input (stdin)

Output

Run your code to see output here...