Computer Science, asked by shoptorshiMondal, 9 months ago

Design a class to overload a function Sum( ) as follows:
(i) int Sum(int A, int B) – with two integer arguments (A and B) calculate and return
sum of all the even numbers in the range of A and B.
Sample input: A=4 and B=16
Sample output: sum = 4 + 6 + 8 + 10 + 12 + 14 + 16
(ii) double Sum( double N ) – with one double arguments(N) calculate and return
the product of the following series:
sum = 1.0 x 1.2 x 1.4 x …………. x N
(iii) int Sum(int N) - with one integer argument (N) calculate and return sum of only
odd digits of the number N.
Sample input : N=43961
Sample output : sum = 3 + 9 + 1 = 13
Write the main method to create an object and invoke the above methods.

Answers

Answered by mohdyafi
0

Answer:

dont djhdhdjdhddhxhxjjc

Similar questions