Given two integer a and b, find whether their product (a x b) exceed the signed 64 bit integer or not. If it exceed print Yes else print No.
Input : a = 100, b = 200 Output : No Input : a = 10000000000, b = -10000000000 Output : Yes
- If either of the number is 0, then it will never exceed the range.
- Else if the product of the two divided by one equals the other, then also it will be in range.
- In any other case overflow will occur.
Time complexity : O(1)
GeeksforGeeks has prepared a complete interview preparation course with premium videos, theory, practice problems, TA support and many more features. Please refer Placement 100 for details
- How to avoid overflow in modular multiplication?
- Reverse digits of an integer with overflow handled
- Program to check if tank will overflow, underflow or filled in given time
- Heap overflow and Stack overflow
- Check if two Integer are anagrams of each other
- Check if the given array contains all the divisors of some integer
- Check if an integer can be expressed as a sum of two semi-primes
- Buffer Overflow Attack with Example
- Compute average of two numbers without overflow
- Minimum decrements to make integer A divisible by integer B
- Modular Multiplication
- Booth’s Multiplication Algorithm
- Right most non-zero digit in multiplication of array elements
- Count divisors of array multiplication
- Multiplication of two complex numbers given as strings
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.