Question

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;
}

 

19 Mar 2023
Answer :
Word Count : 187

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

IGNOU NEWS
Assignment Submission Last Date Extended Till 30 June 2026 Click Here★★★IGNOU June 2026 TEE Date Sheet Released Click Here★★★
Top
📞
Call Support Instant phone assistance What does the following C function compute? Discover. int some
→
🟢
WhatsApp Chat Fast live messaging
→
Email Us Business enquiries & support
→