Skip to main content
C Code Completion Easy +10 XP

Scanf Input

Complete the scanf format for reading an integer.

CFill in the blank
int n;
scanf("___", &n);

Type the missing code

Show answer and explanation

Answer: %d

%d is the format specifier for signed integers in scanf. Note &n (address-of) — scanf needs the address to write to.

Hint: Same format specifier as printf for integers.

What this challenge tests

Code Completion in C: scanf, input.

Related challenges