Computer Science, asked by koral143, 2 months ago

Create a class method to find the difference between square of first ten number and the square of the sum

Answers

Answered by jannat5572
2

Input : n = 3

Output : 22.0

Sum of first three numbers is 3 + 2 + 1 = 6

Square of the sum = 36

Sum of squares of first three is 9 + 4 + 1 = 14

Absolute difference = 36 - 14 = 22

Input : n = 10

Output : 2640.0

hope this will help u ❤

Similar questions