The standard input box supplies text to the program when you press Run code. Enter 12 8 to supply two integers. The & operator passes the address of each variable so that scanf can store a converted value there.
Validate the conversion
scanf returns the number of successful conversions. This program needs two. A failed conversion produces a message and ends the program. It then restricts both values to a small range before adding them.
Expected output
Sum: 20
Practise
Try 15 and -4, then try the text hello. Predict the result before running. Use the Example input button to return to the starting values.
Common mistake
Do not use a variable after a failed conversion. This introductory scanf example expects text representable as int; extremely long numbers are not a safe input. For robust untrusted input parsing, use fgets with strtol and explicit range checks.