Question: Q7. a. Declare two functions: void func1(); void func2(); b. Implement/Create these two functions: Each will have two statements/lines of code: In the function func1,
Q7.
a. Declare two functions:
void func1();
void func2();
b. Implement/Create these two functions:
Each will have two statements/lines of code:
In the function func1, the first line prints the integer 1 and the second line just calls the function func2.
In the function func2, the first line prints the integer 2 and the second line just calls back the function func1.
c. Your main function should have just one statement/line of code: Just the call to func1, like below:
void main(){
func1();
}
d. Include on top for the printf statement.
Since you're calling one function from the other and back, does the code prints infinite 121212s just like in a loop?
Q8.
a. Declare a function like below:
int multiplyTwoIntegers(int integer1, int integer2);
b. Implement/Create the above function.
c. Call the above function from the main function like:
int firstInteger = 5;
int secondInteger = 6;
int multiplicationResult = multiplyTwoIntegers(firstInteger, secondInteger);
And Print the multiplicationResult.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
