i'm having a problem with this operation that is not really giving the right result. The result is 60216 on terminal, but it should be 563376.
int a = 8536;
int b = 563376;
int d = 8536;
unsigned long long int k = (a*b);
cout << k/d << endl;
i'm having a problem with this operation that is not really giving the right result. The result is 60216 on terminal, but it should be 563376.
int a = 8536;
int b = 563376;
int d = 8536;
unsigned long long int k = (a*b);
cout << k/d << endl;
you need long long everywhere
long long int a = 8536;
long long int b = 563376;
long long int d = 8536;
unsigned long long int k = (a * b);
std::cout << k / d << std::endl;
note that its nothing to do with division. THis
int a = 8536;
int b = 563376;
unsigned long long int k = (a * b);
std::cout << k << std::endl;
gives the wrong answer too