Yatra.com Interview Question
Software Engineer / DevelopersCountry: India
Interview Type: In-Person
actually we have to write a function that returns floor and ceiling values of sqrt(n);
Prototype of function is
int func_floor_ceil(int n)
{// calculating sqrt(n); i.e x=sqrt(n);
//return floor or ceiling value of x
}
public class Test {
- Ankit Jain October 16, 2014public static void main(String[] args) {
int num = 16;
for(int i=2;i<=num/2;i++) {
if((i*i) == num){
System.out.println(i);
}
}
}
}