Answer:
#include <stdio.h>
int fib(int n) {
if (n <= 0) {
return 0;
}
if (n <= 2) {
return 1;
}
return fib(n-1) + fib(n-2);
}
int main(void) {
for(int nr=0; nr<=20; nr++)
printf("Fibonacci %d is %d\n", nr, fib(nr) );
return 0;
}
Explanation:
The code is a literal translation of the definition using a recursive function.
The recursive function is not per se a very efficient one.
Answer:
t= 8.7*10⁻⁴ sec.
Explanation:
If the signal were able to traverse this distance at an infinite speed, the propagation delay would be zero.
As this is not possible, (the maximum speed of interactions in the universe is equal to the speed of light), there will be a finite propagation delay.
Assuming that the signal propagates at a constant speed, which is equal to 2.3*10⁸ m/s (due to the characteristics of the cable, it is not the same as if it were propagating in vaccum, at 3.0*10⁸ m/s), the time taken to the signal to traverse the 200 km, which is equal to the propagation delay, can be found applying the average velocity definition:

If we choose x₀ = 0 and t₀ =0, and replace v= 2.3*10⁸ m/s, and xf=2*10⁵ m, we can solve for t:

⇒ t = 8.7*10⁻⁴ sec.
Answer:
Object-oriented programming
Explanation:
When used in object-oriented programming , a class is a factory for creating object. An object is a collection of data and behavaiors that represent some entity(real or abstract).
The three real-life objects that are instances of each of the following classes are given below:
a.<u> Song:</u>
The song Believe in yourself is an instance of song class
The song Where do broken hearts go is an instance of song class.
The song Ambition is an instance of song class
b. <u>CollegeCourse</u>
The College course Engineering is an instance of College course class
The College course Accounting is an instance of College course class
The College course Medicine is an instance of College course class
c. <u>Musician:</u>
The musician Rihanna is an instance of musician class.
The musician Sean Paul is an instance of musician class.
The musician Wyclef is an instance of musician class.
Real-life objects refer to the things that are characterized together as they share common qualities. The assignment simply wants you to name examples under the categories given.
Read related link on:
brainly.com/question/16699733