I have some code here that I need to fill in but I have no idea how to call a function from another function from the outside of main, Im a total beginner on this and any help would be appreciated.
The output is supposed to look something like this:
Arithmetic Sequence: 17 23 29 35 41
Arithmetic Sequence: 10 16 22 28 34 40 46 52 58 64
Harmonic Sequence: 1.00 0.50 0.33 0.25 0.20 0.17 0.14 0.12 0.11 0.10
Leonardo Sequence: 1 1 3 5 9 15 25 41 67 109
Code
#include <stdio.h>
#include <stdlib.h>
/* void ArithmeticSequence(start, increment, count)
Print an arithmetic sequence with the provided properties:
- start: first value in the sequence
- increment: the increment value between each pair of values in the sequence
- count: number of terms to generate
*/
void ArithmeticSequence(int start, int increment, int count){
int k;
int a;
printf("Arithmetic Sequence: \n");
for (k=0; k<count; k++ ){
printf("%5d", a);
a = a + increment;
}
printf("\n");
}
/* HarmonicSequence()
Print the first 10 entries of the harmonic sequence.
*/
void HarmonicSequence(){
/* Your code here */
}
/* LeonardoSequence()
Print the first 10 entries of the Leonardo sequence.
*/
void LeonardoSequence(){
/* Your code here */
}
/* Do not change any code below this line */
int main(){
ArithmeticSequence(17, 6, 5);
ArithmeticSequence(10, 6, 10);
HarmonicSequence();
LeonardoSequence();
return 0;
}
return EXIT_SUCCESS;
}The output is supposed to look something like this:
Arithmetic Sequence: 17 23 29 35 41
Arithmetic Sequence: 10 16 22 28 34 40 46 52 58 64
Harmonic Sequence: 1.00 0.50 0.33 0.25 0.20 0.17 0.14 0.12 0.11 0.10
Leonardo Sequence: 1 1 3 5 9 15 25 41 67 109

