Sorry we chose 0 for the denominator
Answer:Following is the C program:-
#include <stdio.h>
int fun()//function fun of return type int and it returns value 6.
{
return 6;
}
int main() {
int a, b;
a = 10;
b = a + fun();//adds 6 to a.
printf("With the function call on the right, ");
printf("\n%d ",b);//printing b..
return 0;
}
Output:-
With the function call on the right,
16
Explanation:
The function fun return the value 6 so it adds 6 to a and stores the result in b.
Answer:
Could you seperate them if they are different answers? I'm lost, sorry!
Explanation:
Answer:
function sum(number) {
if (number == 1) {
return 1;
}
return number + sum(number -1);
}
Explanation:
This is a recursive function, it means that is a function that calls itself for example: if you call the function with sum(5) the process is :
sum(5)
|______ 5 + sum(4)
|_______ 4 + sum(3)
|______ 3 + sum(2)
|_____2 + sum(1)
|_____ 1
the result is 1+2+3+4+5 = 15
It does look like a model
Hope it helps I mean just my opinion.