Question: using c language and given parameters please write code that reads from a text file i am given IMEI is a unique number of 15
IMEI is a unique number of 15 digits given to every mobile phone resource: https:/len wikipedia org/wiki/Intemational Mobile Equipment Identity A method to check if the device is really made by the official manufacturer is to compare the IMEI's last digit, called Luhn digit, with a check digit. If the Luhn digit is equal to the check digit, the device is most probably authentic. Otherwise, it is not authentic for sure. The check digit is calculated as follows: 1) First, we calculate the SUM of the first IMEI's 14 digits by adding a) the digits in the odd positions b) the double of the digits in the even positions. If the double of the digit is a two-digit number, we add each digit separately. For example, suppose that the value of the digit is 8, its double is 16. We therefore add to the SUM the result of 1+6 7 (and not l 6) 2) If the last digit of the calculated SUM is 0, that is the check digit. If not, we subtract the last digit of the calculated SUM from 10 and that is the check digit. For example: let's check the IMEI 357683036257378. Note: the last digit of the given IMEI above is 8 which is the Luhn digit Apply the above algorithm (by hand) to the first 14 digits, we get 34 (2x5) +7 + (2x6)-8-(2x3) + 0 + (2x3) + 6 + (2x2) + 5+ (2x7) +34 (2x7) 34(1)+7 + (3)-8-. (6)-0 (6)-6-(4) + 5+ (5)-3-(5) = 62 Then the check digit = 10-2-8. Since the check digit (-8) is equal to the Luhn digit (-8), this IMEl is valid
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
