Starting from:

$25

CSE107-Lab 6 Solved

Write a C program that performs the task described below

 

1          Task
 

The Fibonacci sequence is a series whose first two elements are 0 and 1, and each subsequent element equals the sum of the two preceding elements. There is a Fibonacci sequence sample below.

 

0 1 1 2 3 5 8 13 21 ...

 

Write a program that waits the user to enter a term number and prints the fibonacci numbers on the screen.

 

An example of the program:

Please enter how many terms you would like to print: 10

Top 10 terms: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34

 

2          Task
 

Write a program that waits the user to enter a number and prints whether the number is prime or not.

 

3         Task
 

A perfect number is a number whose sum of all positive divisors except itself is equal to itself.

 

For example 28 is the perfect number because 28 = 1 + 2 + 4 + 7 + 14.

 

Write a program that waits for the user to enter a number and prints whether the number is a perfect number or not.

 

 

More products