Complete the code to declare a function prototype for modular programming.
void [1]();main as a prototype name here, which is reserved for the program entry point.return instead of a function name.The function prototype declares a function named calculate which can be defined separately, supporting modular programming.
Complete the code to call a function named processData.
[1]();return as a function call.int or void instead of the function name.Calling the function processData executes the code inside that function, which is a key part of modular programming.
Fix the error in the function definition by completing the missing return type.
[1] add(int a, int b) { return a + b; }
void which means no value is returned.float or char which do not match the returned integer.The function add returns the sum of two integers, so its return type must be int.
Fill both blanks to create a modular program that calls a function and prints the result.
#include <stdio.h> int [1](int x, int y) { return x + y; } int main() { int result = [2](5, 3); printf("Result: %d\n", result); return 0; }
The function add is defined and called in main. This shows modular programming by separating the addition logic into its own function.
Fill all five blanks to complete a modular program with function declaration, definition, and call.
#include <stdio.h> [1] [2](int a, int b); int main() { int sum = [3](10, 20); printf("Sum is %d\n", sum); return 0; } [4] [5](int a, int b) { return a + b; }
The function add is declared and defined with return type int, and called in main. This modular approach separates declaration, definition, and usage.