Trace partial input completion

A logger runs the following code independently for each input row. Each input is followed by a newline, and no input errors occur. Complete the table with the return value, final sample count, and final duration in seconds. Use exact integers or short decimals.


C
int samples = -1;
double seconds = -1.0;
int rc = scanf("%d %lf", &samples, &seconds);
Input textrcsamplesseconds (s)
8 2.5
9 bad
stop

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

More STDIO.H and STDLIB.H Questions: