← Back to Course

Lesson 4: Overflow Due to Addition

Practice Questions

Question 1: You are given the Solidity expression z = x + y. All three variables are of type uint24. x holds the value 109223. What is the largest value y can hold?

Question 2: You are given the Solidity expression z = x + y. All three variables are of type uint40. x holds the value 63072000000. What is the largest value y can hold?

Question 3: You are given the Solidity expression z = x + y. All three variables are of type uint256. x holds the value 1809251394333065553493296640760748560207343510400633813116524750123642650624. What is the largest value y can hold?

Question 4: You are given the Solidity expression z = x + y. All three variables are of type uint32. x holds the value 1197254175. What is the largest value y can hold?

Question 5: You are given the Solidity expression z = x + y. All three variables are of type uint80. x holds the value 302231454903657293676555. What is the largest value y can hold?