Dividing two int values when you want a decimal: int a = 7, b = 2; double result = a / b; gives you 3.0, not 3.5. The division happens as int before assignment. Storing large products in int: int result = 100000 * 100000; overflows.
Use long long for both the variable and at least one operand. Comparing double values with ==: if (0.1 + 0.2 == 0.3) is often false due to rounding. Use abs(x - y) < 0.000001 instead.