Question
C Programming. How to compare two sets of intergers which are inputted by the user? cannot share any digit at the same place with your
C Programming. How to compare two sets of intergers which are inputted by the user? "cannot share any digit at the same place with your current PIN". Cant use any relational or logical operators.
Example Execution #1 ('3' digit in the hundreds place is common to both PINs):
Enter your current PIN: 12345
Enter your new PIN: 98310
Total number of invalid digits: 1
Example Execution #6:
Enter your current PIN: 19183
Enter your new PIN: 28273
Total number of invalid digits: 1
Dont use any relational or logical operators, dont use user defined functions (diff etc), dont use arrays. Refer to example below to solve.
Problem: Your preferred banking institution is requiring that you change your five digit PIN in the name of security. One requirement of your new PIN is that it cannot share any digit at the same place with your current PIN. Given both the current and new PIN print the total number of invalid digits. Both PIN values will be in the range [00000, 99999] Example Execution #1 (3' digit in the hundreds place is common to both PINs): Enter your current PIN: 12345 Enter your new PIN: 98310 Total number of invalid digits:1 Example Execution #5: Enter your current PIN: 13433 Example Execution #2: Enter your current PIN: 01010 Enter your new PIN: 10101 Enter your new PIN: 43133 Total number of invalid digits: 3 Example Execution #6: Enter your current PIN: 19183 Total number of invalid digits: 0 Example Execution #3: Enter your current PIN 12345 Enter your new PIN: 22345 Enter your new PIN: 28273 Total number of invalid digits:1 Example Execution #7: Enter your current PIN: 12244 Total number of invalid digits: 4 Example Execution #4: Enter your current PIN: 99999 Enter your new PIN: 00000 Enter your new PIN: 44241 Total number of invalid digits: 0 Total number of invalid digits: 2 Please review the ASSIGNMENT REQUIREMENTS for this program. The use of selection, including logical and relational operators, is prohibited. The on pages techniques necessary to solve this problem are similar to the examples found e notes packet
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