+ 1

x <- function(a, b){return(_(a_b))

This is a question that says“Fill it to make a programm that takes two parameters and output the square root of their sum.I am not able to understand what to fill in the return.Please tell me the answer.🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏

8th Feb 2023, 10:40 AM
Vidya Sagar Singh
Vidya Sagar Singh - avatar
1 Respuesta
+ 3
Vidya, What language are you using? Unclear from your post, however... 1) It looks like your missing your closing brace '}' 2) You are being asked to return the square root of their sum, the parameters are 'a' and 'b' - so the gap between a and b is more than likely a '+' symbol for addition - as you want to use addition to find the sum. 3) In the return, it looks like 'a+b' is being used as a parameter for a function/method call (the parenthesis and gap shows this _(a+b). The function you are probably looking for is sqrt - which as you can guess returns the square root. There are also other ways you can calculate the square root, however from what you've provided it looks like your return statement should be: return(sqrt(a+b)) - hopefully that makes sense?
8th Feb 2023, 10:59 AM
DavX
DavX - avatar