A C17 program contains these prototypes, with matching implementations supplied elsewhere:
int encode_count(int count); void report_count(int count); int fixed_count(void);
Each option is an independent proposed addition, placed in an appropriate scope. Select every addition permitted by strict C17 function declaration, call, and return rules.
int count = encode_count(11.8);
void report_count(int value);
double fixed_count(void);
void wrapper(void) { return report_count(11); }
report_count(encode_count(11));
Unlock full course notes by signing up
Convert arguments before calculating ticks
A C17 timer helper produces four ticks per complete second. Its definition appears before the caller:
Inside a valid caller, the program executes:
What value is stored in total? Answer in ticks as an exact integer, to zero decimal places.
Sequence the steps of a prototyped call
A C17 program contains the prototype and call below. The variable w is an int, and the call appears after the prototype is in scope. Assume area finishes by executing a return statement with a value.
Put the steps the program performs for this call in order, from the moment the call expression is reached until r receives its value.
Predict values after return-type conversion
The functions below are compiled as C17 on a system where unsigned char holds 8 bits (values 0 to 255).
Each call in the table is printed with printf("%d\n", ...) when the function returns an integer type, and with printf("%.1f\n", ...) when it returns double. Enter exactly what each call prints, as a whole number or a number with one decimal place.