Answered step by step
Verified Expert Solution
Question
1 Approved Answer
please write in C language: // upc.c program : 6. European countries use a 13-digit code, known as a European Article Number (EAN) instead of
please write in C language:
// upc.c program :
6. European countries use a 13-digit code, known as a European Article Number (EAN) instead of the 12-digit Universal Product Code (UPC) found in North America. Each EAN ends with a check digit, just as a UPC does. The technique for calculating the check digit is also similar Add the second. fourth. sixth, cighth, tenth. and twelfth digits. Add the first, third. fifth. seventh. ninth. and eleventh digits. Multiply the first sum by 3 and add to the second sum Expressions Subtrac from the total. Compute the remainder when the adjusted total is divided by 10 Subtract the remainder from 9 For example, consider Glloglu Turkish Delight Pistachio & Coconut, which has an EAN of 8691484260008. The first sum is 6+18+2+0+0 17, and the second sum is 89+ 4 +46+0 31. Multiplying the first sum by 3 and adding the second yields 82. Subtac ing I gives 81. The remainder upon dividing by 10 is . When the remainder is subtracted from 9, the result is 8, which matches the last digit of the original code. Your job is to mod ify the upc.c program of Section 4.1 so tha it calculates the check digit for an EAN. The user will enter the first 12 digits of the EAN as a single number: Enter the first 12 digits of an EAN: 86914 8426000 Check diait: 8 upc.c /*Computes a Universal Product Code check digit / #includeStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started