Add Two Numbers
Completed
Read two integers and print their sum.
Input
Two integers.
Output
The sum.
Example
Input
3 4
Output
7
Editor
C
Hints
scanf needs the address of each variable: &a.
%d skips spaces and new lines before the number.
Solution explanation
&a gives scanf the memory location to store the value in.
Show solution
#include <stdio.h>
int main() {
int a, b;
scanf("%d %d", &a, &b);
printf("%d\n", a + b);
return 0;
}