Write a JAVA program to find the value of S
S=1 + + + + …………………………………..
Answers
Answered by
1
Explanation:
tot = 0
for ( x : [1:n+1] ) {
tot += (( x * (x+1) ) / 2 )
}
println(tot)
or in much succinct way :
sum ( [1:n+1] ) as { ( $.o * ($.o + 1) ) / 2 }
Answered by
0
Answer:
tot=0
for ( x :1:n +1))
tot+= (( x*).
( x+1 ) ) / 2 )
or in much succinct way :
i hope it helps you ❣️
THANKS Me
AND MAKE ME AS Brainlist
:-)^_^}:‑);)(•‿•)(•‿•)
Similar questions