I'm just learning C and I have this simple code that is suppose to find the sum of two integers.
Code:#include <stdio.h> #include <conio.h> void main() { int integer1, integer2, sum; printf("Enter the first integer\n"); scanf("%d", &integer1); printf("Enter second integer\n"); scanf("%d", &integer1); sum = integer1 + integer2; printf("Sum is %d\n", sum); getch(); }
Whenever I add it into the Dev C++ compiler, the output looks something like this...
Enter the first integer
5
Enter second integer
5
Sum is 7601673
Can someone please tell me what I'm not doing to get the answer to be 10? Thanks.
[edit]Code tags added by Hammer.