Instructions 1. In this general syntax of a function: type name ( paraneter1, pa
ID: 3743168 • Letter: I
Question
Instructions 1. In this general syntax of a function: type name ( paraneter1, parameter2, ...) ( statements) what is another name for the statements? 2. For the following function header answer the 3 questions below float Division (float x, float y) + what is the generic name for x and y? -what is the name of the function? - show a possible call of this function 3. What is main() in a C++ program? 4.In the following program (the one in the such that the program adds any 2 numbers that the user wants, and not just 5 and 3. tutorial you were supposed to read and understand), make a change //function example # include using namespace std; int addition (int a, int b) int r; r a+b; return r int main ) int z z- addition (5,3); coutExplanation / Answer
1. Body of the funciton
2.
- Parameters
- Division
- Division(2.3, 4.4)
3. The default function which is called where the execution starts
4.
#include <iostream>
using namespace std;
int addition(int a, int b)
{
int r;
r = a + b;
return r;
}
int main() {
int z, x, y;
cout << "Enter 2 numbers: ";
cin >> x;
cin >> y;
z = addition(x, y);
cout << "The result is "<< z;
}
/*SAMPLE OUTPUT
Enter 2 numbers: 2 5
The result is 7
*/