Add two numbers
Read two whole numbers separated by a space and print their sum.
Use scanf("%d %d", &a, &b) to read them.
Input
3 4
Expected output
7
Input
-10 25
Expected output
15
Show a hint
printf("%d\n", a + b) prints the result followed by a new line.
Show a solution
Loading the editor…
Run the tests to check your solution.