Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please write in C language: // upc.c program: 5. Rewrite the upc.c program of Section 4.1 so that the user enters 11 digits at one

please write in C language:

image text in transcribed

// upc.c program:

image text in transcribed

5. Rewrite the upc.c program of Section 4.1 so that the user enters 11 digits at one time. instead of entering one digit. then five digits, and then another five digits. Enter the first 11 digits of a UPC: 01380015173 Check digit: 5 upc.c /*Computes a Universal Product Code check digit / #include int main (void) first sum, second sum, total; printf ("Enter the first (single) digit: ") scanf ( " % ld", &d) ; printf ("Enter first group of five digits: " scanf ( " % 1d%ld%ld% ld%ld", &il, &i2, &13, &14 , &i5); printf ("Enter second group of five digits: ") The missing check digits are 8 (Jif) and 6 (0cein Spray). Chapter 4 Expressions first sumd12 i4 + jlj3 j5 secondsum i1 + 13 + 15 + j2 + j4; total 3first sum second_sum; - printf("Check digit: %d ", 9 - ((total - 1) % 10)); return 0

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions