205k views
5 votes
Define stubs for the functions get_user_num() and compute_avg()?

1 Answer

4 votes

Final answer:

To define stubs for the functions get_user_num() and compute_avg(), you need to create function declarations without their implementations. By creating these stubs, you can compile your code without errors, but you will need to later implement the functions by adding the actual code that performs their intended tasks.

Step-by-step explanation:

To define stubs for the functions get_user_num() and compute_avg(), you need to create function declarations without their implementations. In other words, you define the function name, return type, and parameters, but leave the function body empty.

Here is an example of a stub for the get_user_num() function:

int get_user_num();

And here is an example of a stub for the compute_avg() function:

double compute_avg(int num1, int num2);

By creating these stubs, you can compile your code without errors, but you will need to later implement the functions by adding the actual code that performs their intended tasks.

User Taquion
by
8.2k points