Question: Create a C program that determines how many digits two integer numbers have in common. You can assume that: The two integer numbers will always

Create a C program that determines how many digits two integer numbers have in common.

You can assume that: The two integer numbers will always have 4 digits. For instance 1234 is an integer number with 4 digits.

Hint: You must extract the digits out of the numbers. To do this extraction remember that: 1234%10 = 4 1234/10 = 123 These are the steps you should follow:

a. Declare the integer variables

b. Use print to ask the user for the first number and read the number using scan

c. Use print to ask the user for the second number and read the number using scan

b. Use the division (/) and modulo (%) operations to extract the four digits out of each number

c. Use as many if statements as needed to count the number of common digits

d. Use print to print the number of common digits

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!