What does the following C function compute? Discover.
int some fun(int n)
{
if(n%2 == 0)
return 2;
int d, s = sqrt(n);
for(d = 3; d <= s; d = d+2)
if(n%d == 0)
return d;
return n;
}
The given C function some_fun takes an integer n as input and returns an integer as output.
If n is an even number, the function immediately returns the value 2. This ___ _____ ________ ______ _______ ________ ________ ___ _________ ______.
____ _____ ________ ____ _____ ______.
_______ ________ __________ ________ __________ _____ ______.
____ _________ __________ _________ __________.
_________ _________ ____ ____ ______ _________ _________.
________ ____ __________ ___ __________ ________ ___ __________ ________ _____ _________ _____.
_____ ______ ______ __________ ____ ___ _______ _____ _______.
____ ___ _________ _____ _______ _________ ________ _______ ________.
____ __________ ______ ___ ___ ________ _________ ____ _____ _________ _____.
___ _________ _________ _______ _________ _________ _____ _________ _______ _____ ___.
____ ________ ______ ______ _________.
____ ________ _______ ____ ___ _____ ________ __________ _______ ___.
____ _______ _____ _________ ________.
_________ ________ ___ ___ _______ ________.
________ ________ ______ __________ ________ __________ ___ ______ _____ ________ ____.
__________ ____ _______ _____ ______ _____ _______ ______ _______.
_____ _______ ___ ___ _______ ___ __________ ____ _______ _________.
_______ _____ _____ _______ _____ _______ ______ __________.
________ _______ _____ _______ ______.
Get Full Answer on WhatsApp