0
Kindly help me here
Kindly help me complete this project please..... I was done with the lessons in 4 days and am unable to get my certificate since have not been able to complete the projects😭 You need to create a function that takes two parameters and returns the sum of all numbers between the two parameters inclusive. The given code takes two numbers from input and passes them to a function called rangeSum(). Task Define the rangeSum() function, so that the code works as expected. Sample Input 4 9 Sample Output [1] 39 Explanation For the inputs 4 and 9, the returned value should be 39.
4 Respostas
+ 2
What is your attempt?
+ 2
PHILEMON MAKUBO NYAMAGAINI Please do yourself firstly and if you have doubt or error in code then share to us, we try to solve your doubt/error on your code.
0
Justice here is what I tried...
rangeSum<-function(a,b){
rangeSum<-0
for(i in a:b){
rangeSum<-rangeSum+i
}
return(rangeSum)
}
rangeSum(42,64)
but I got only test case 1 correct. the rest are marked wrong I don't know why
0
Sakshi , SYED ARHAM HASAN
Justice here is what I tried...
rangeSum<-function(a,b){
rangeSum<-0
for(i in a:b){
rangeSum<-rangeSum+i
}
return(rangeSum)
}
rangeSum(42,64)
but I got only test case 1 correct. the rest are marked wrong I don't know why