Квиз по C: printf & scanf

This C quiz tests the format strings of printf and scanf. You will predict formatted output with widths, precision and padding, pick the right conversion specifiers and learn why scanf needs addresses.

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

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

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

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

Вопрос 1 из 10

What does this print?

#include <stdio.h>

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

C. 2 + 3 = 5 Each %d is replaced by the next argument in order: 2, 3 and the value of 2 + 3, which is 5. The expression is evaluated before printf sees it.

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

  • Conversion specifiers like %d, %f, %x, %c and %s
  • Width, precision, zero padding and left alignment
  • Printing a literal %
  • Why scanf takes &variable and what it returns
  • %lf in scanf vs %f in printf

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

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

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

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

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