Квиз по C: Functions & Prototypes

This C quiz covers the basics of functions, from return values and void functions to prototypes. You will predict what function calls return and spot calls the compiler rejects.

Лёгкий 10 вопроса ~5 минуты Проходной балл: 80% C17

Выберите режим

Вы играете как гость: войдите, чтобы сохранить XP и серию.

Пример вопроса

Вопрос 1 из 10

What does this print?

#include <stdio.h>

int square(int n) {
    return n * n;
}

int main(void) {
    printf("%d\n", square(3) + square(2));
    return 0;
}
Показать ответ

C. 13 Each call is evaluated on its own: square(3) is 9 and square(2) is 4, so the sum is 13. 25 would be square(3 + 2).

Что проверяет этот квиз

  • Defining functions with parameters and a return type
  • void functions and return
  • Prototypes and why they come before the call
  • int f(void) vs int f()
  • Return value conversions and nested calls

Частые вопросы

Нужен ли аккаунт?

Нет. Играть может любой. Войдите, чтобы сохранять XP, серию, значки и историю.

Можно пройти ещё раз?

Да. Лучший результат сохраняется, а вопросы и ответы каждый раз перемешиваются.