Quiz de 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.

Fácil 10 perguntas ~5 minutos Aprovação com 80% C17

Escolha um modo

Jogando como visitante: entre para guardar seu XP e sua sequência.

Pergunta de exemplo

Pergunta 1 de 10

What does this print?

#include <stdio.h>

int main(void) {
    printf("%d + %d = %d\n", 2, 3, 2 + 3);
    return 0;
}
Mostrar a resposta

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.

O que este quiz cobre

  • 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

Perguntas frequentes

Preciso de uma conta?

Não. Qualquer pessoa pode jogar. Entre para guardar seu XP, sequência, badges e histórico.

Posso refazer?

Pode. Sua melhor nota fica salva, e as perguntas e respostas são embaralhadas a cada vez.