← Your First C Program

Echo a Number

easy

Read one integer typed as input, and print it back in the form You entered: 7.

This is the first time your program’s output depends on something it reads, rather than a value you typed directly into the source code. scanf is printf’s counterpart for reading input, and it uses the same %d placeholder – but notice the starter code has &n, not just n, in the scanf line. Don’t worry about exactly why yet; just copy the pattern (scanf("%d", &something) to read, printf("...", something) to print) for now. Module 2 explains precisely what that & is doing.

Your solution

"Run" uses the sample stdin ("7"). "Submit" checks your code against all 3 test cases.

Test results

Submit your solution to run it against all test cases.

Hints

    Reference solution