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

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

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 Databases Questions!