International Mobile Equipment Identity (IMEI) is a number, usually unique, to identify mobile phones, as well as some satellite phones. It is usually found printed inside the battery compartment of the phone, but can also be displayed on-screen on most phones by entering *#06# on the dialpad, or alongside other system information in the settings menu on smartphone operating systems. The IMEI number is used by a GSM network to identify valid devices and therefore can be used for stopping a stolen phone from accessing that network.
The IMEI (15 decimal digits: 14 digits plus a check digit) includes information on the origin, model, and serial number of the device.
The IMEI is validated in following steps:
- Starting from the rightmost digit, double the value of every second digit (e.g., 7 becomes 14).
- If doubling of a number results in a two digits number i.e greater than 9(e.g., 7 × 2 = 14), then add the digits of the product (e.g., 14: 1 + 4 = 5), to get a single digit number.
- Now take the sum of all the digits.
- Check if the sum is divisible by 10 i.e.(total modulo 10 is equal to 0) then the IMEI number is valid; else it is not valid.
Input IMEI : 490154203237518 Output : Since, 60 is divisible by 10, hence the given IMEI number is Valid.
Valid IMEI Code
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.
- A Program to check if strings are rotations of each other or not
- Write a program to print all permutations of a given string
- Write a program to reverse an array or string
- Check for balanced parentheses in an expression
- Check whether two strings are anagram of each other
- Given a number, find the next smallest palindrome
- Program to validate an IP address
- Find Excel column name from a given column number
- How to turn off a particular bit in a number?
- Check if a given string is a rotation of a palindrome
- Check a given sentence for a given set of simple grammer rules
- Given a binary string, count number of substrings that start and end with 1.
- Factorial of a large number
- Function to find Number of customers who could not get a computer
- Check if a given sequence of moves for a robot is circular or not
- Build Lowest Number by Removing n digits from a given number
- Converting Decimal Number lying between 1 to 3999 to Roman Numerals
- Transform One String to Another using Minimum Number of Given Operation
- Check if two given strings are isomorphic to each other
- Length of the longest valid substring
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.