A program contains the following function.
int cube(int num) {
return num * num * num; }
Write a statement that passes the value 4 to this function and assigns its return value to the variable result.
Could someone please guide me to the right direction? Please find my code below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
#include <iostream>
usingnamespace std;
// Function Prototype
int cube(int);
int main() {
int result;
result = cube(4);
return 0;
}
int cube(int num) {
return num * num * num;
}