In: Computer Science
SOLUTION
EXPLANATION
WE GET A NEGAIVE NUMBER, BECAUSE WHEN OVERFLOW OCCURS AT 2'S COMLEMENT AND IT AGAIN STARTS FROM NEGATIVE BOUNDARY. LIKE FOR INT RANGE IS (-2147483648,2147483647). SO WHEN 2 BILLION + 2 BILLION COMES. IT WILL ADD TILL MAX VALUE THEN STARTS ROTATING i.e. ADDING IN NEGATIVE BOUNDARY.
NOW, IN 2B+2B, [2B +147483647 + 1852516353 = 2147483647 +1852516353]. NOW AFTER ADDING 1 OVERFLOW OCCURS AND IT STARTS ROTATING AND IT BECOMES [-2147483648 + 1852516352 = -294967296]
EXPLANATION
WE GET INEXACT RESULT ON INTEGER DIVISION BECAUSE. INTEGERS ARE THE NUMBERS THAT CAN BE WRITTENED WITHOUT FRACTIONAL COMPONENT. SO WHILE DIVIDING A NUMBER. IT ONLY CONSIDERS ITS NON-FRACTIONAL PART AND EXCLUDES ITS FRACTIONAL COMPONENT. FOR 2/5 ANSWER IS 0.4, BUT IT EXCLUDES .4 AND KEEPS ONLY 0 THAT IS ITS INTEGER VALUE. FOR 51/25 = 2.04, IT ONLY KEEPS INT VALUE THAT IS 2.
##### FOR ANY QUERY, KINDLY GET BACK, THANKYOU. #####