Large integer number is showing incorrect output even after using long in bellow code, but still it is showing incorrect result. How I can improve?
#include<stdio.h>
#include<conio.h>
void main()
{
long a, b, result;
a=1234;
b=19887815769532909;
result= (0.5)*(a+b)*(a+b+1)*b;
printf("%d", result);
getch();
}
but output is showing something like : -2147483648
I think I am doing something wrong with variable with large number. I have also tried int long but failed.
Please help.