Q: Two numbers will be given. I have to show the sum, sub and multi of them. Here is my code:
#include <stdio.h>
int main(){
int a, b;
long long int result1, result2, result3;
scanf("%d%d", &a, &b);
result1=a+b;
result2=a*b;
result3=a-b;
printf("%d + %d = %lld\n", a, b, result1);
printf("%d * %d = %lld\n", a, b, result2);
printf("%d - %d = %lld\n", a, b, result3);
return 0;
}
Expected result:
60642 + 92657 = 153299
60642 * 92657 = 5618905794
60642 - 92657 = -32015
Result I am getting:
60642 + 92657 = 153299
60642 * 92657 = 1323938498
60642 - 92657 = -32015
Can you explain why it's happening only with multiplication?