square root

 #include<iostream>

#include<cmath>

using namespace std;


int main() {

    // Write C++ code here

    int num=0,n;

    cin>>n;

    while(num*num<=n){

        num=num+1;

    }

    num=num-1;

    cout<<num;


    return 0;

}

Comments

Popular posts from this blog

Sum of Even Numbers till N

Find the Runner-Up Score!

Print All Substrings