Quiz on Functions

Let's refresh what we've learned about functions with this quiz.

1

What will be printed to the screen?

void sum(int a, int b) {
  int sum = a + b;
  return sum;
}

int main(void) {
  int x = 3, y = 4;
  printf("%d", sum(x, y));
  return 0;
}
A)

7

B)

A compilation error

C)

34

Question 1 of 40 attempted

Create a free account to access the full course.

By signing up, you agree to Educative's Terms of Service and Privacy Policy