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
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