Computer Science, asked by mayank2007raj, 3 months ago

Write a program to accept a number and display sum of its even factor.​

Answers

Answered by rashmisethi337
1

Answer:

In this article, we will learn about the solution to the problem statement given below.

Problem statement − We are given a number, we need to display the sum of all even factors of the number.

Approach

We check whether the number is odd, then there are no even factors, so return 0.

If the number is even, we go through the computation. All other terms except 20 multiply to produce an even factor sum.

To remove all odd numbers in even factor, we ignore the 20 which is 1. After this step, we only got even factors. Note that 2 is the only even prime available to us.

Similar questions