Fibonacci series and prime factorisation
Description
We have to do this without using recurrence
using only for,if,while, do loop
Problem 1: EVEN FIBONACCIS
In mathematics the sequence Fn of Fibonacci numbers is defined by the recurrence relation: Fn = Fn-1 + Fn-2 where F0 = 0 and F1 = 1
In other words, every Fibonacci number is the sum of the previous two Fibonacci numbers with the first two Fibonacci numbers defined as 0 and 1. Here are the first 10 numbers of the Fibonacci sequence.
0, 1, 1, 2, 3, 5, 8, 13, 21, 34
In this problem, given an input integer X (from the user) you have to output the sum of all even Fibonacci numbers below X.
For example, if X = 35 then the sum of all even Fibonacci numbers below X is 44.
If X = 34 then the sum of all even Fibonacci numbers below X is 10. Sample input and outputs follow.
Sample Input and Output 1
Enter max limit
100
The sum of all even fibonaccis before 100 is: 44
Sample Input and Output 2
Enter max limit
34
The sum of all even fibonaccis before 34 is: 10
Problem 2: PRIME FACTORS
In this problem, given an input integer X (from the user) you have to output all of its prime factors as well as the minimum and maximum prime factors separately. Sample input and outputs follow.
Sample Input and Output 1
Enter an Integer:
78
Prime Factorization: 2 x 3 x 13 Minimum: 2, Maximum: 13
Sample Input and Output 2
Enter an Integer:
4620
Prime Factorization: 2 x 2 x 3 x 5 x 7 x 11 Minimum: 2, Maximum: 11
Prime factorization of an integer is breaking the integer down into a set of prime numbers which multiply together to result in the original integer.
For example, the prime factorization of 28 is 2 x 2 x 7. The prime factorization of 321 is 3 x 107.
Previous answers to this question
This is a preview of an assignment submitted on our website by a student. If you need help with this question or any assignment help, click on the order button below and get started. We guarantee authentic, quality, 100% plagiarism free work or your money back.