CJCoding With Joseph
15free / daySign inCreate account

Read Single Integer

Write a program that reads a single integer from the user using scanf and prints it back with the message:

You entered: [number]

Use %d format specifier with scanf to read the integer, and make sure to use the & operator before the variable name in scanf.

Expected Output:

You entered: 42

= newline. No newline after the last line.

Hints3 available
Topics:
User Input
📥 Auto-Input:
42\n
This input is automatically fed to your program's stdin
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Shift+Alt+F to format · Ctrl+Space to expand shortcuts (p, fori)

Your Output

Run your code to see the output here...

Test Cases

Run your code to see test case results.