Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Name: ID: Question: Write a MATLAB program that prompts the user to enter 4-digit integer number for example: (4691). Check that the entered number is
Name: ID: Question: Write a MATLAB program that prompts the user to enter 4-digit integer number for example: (4691). Check that the entered number is a valid 4-digit number, if it is not valid print "INVALID NUMBER!. Then, the program should check if the first two digits and the last two digits are odd. If they are odd, swap these digits and print the new number. If any of them is even, print No change in the number". Output examples (input is shown in bold): Sample output 1 Please enter your 4-digit number: 2442 The updated number is: No change in the number Sample output 2 Please enter your 4-digit number: 3145 The updated number is: 4531 Sample output 3 Please enter your 4-digit number: 77852 INVALID NUMBER
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered 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