Following repeated names through function calls

An engineering student checks a C function intended to adjust a digital sensor reading measured in integer counts. Determine the values of reading, first, and second in main immediately before return 0;. Enter each answer as an exact integer in counts.


C
int adjust(int reading)
{
    reading += 4;

    {
        int reading = 3;
        reading *= 2;
    }

    return reading;
}

int main(void)
{
    int reading = 10;
    int first = adjust(reading);
    int second = adjust(first);

    return 0;
}
Your answers

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 C Basics Questions: