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)
Don’t stop now and take your learning to the next level. Learn all the important concepts of Data Structures and Algorithms with the help of the most trusted course: DSA Self Paced. Become industry ready at a student-friendly price.
- 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
- Multiplication of two complex numbers given as strings
- Sum of multiplication of triplet of divisors of a number
- Count divisors of array multiplication
- Program to print multiplication table of a number
- Fast Fourier Transformation for poynomial multiplication
- Write you own Power without using multiplication(*) and division(/) operators
- Product of Complex Numbers using three Multiplication Operation
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. 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.