Question: Write a MATLAB code that takes a single 3-digit integer (X) from the user as input and perform the following conditions: a)Check the given integer

 Write a MATLAB code that takes a single 3-digit integer (X)
from the user as input and perform the following conditions: a)Check the

Write a MATLAB code that takes a single 3-digit integer (X) from the user as input and perform the following conditions: a)Check the given integer is divisible by 2 and 5 b)Check the given integer is divisible by 2 and not by 5 c)Check the given integer is divisible by 5 and not by 2 d)Check the given integer is neither divisible by 5 nor by 2 Hint 1: rem(X.3) and rem(X,5) or mod (X.3) and mod (X,5) Hint 2: The input should be strictly a 3-digit number like (135). Check that the entered number is a valid 3-digit number if it is not valid print "NOT VALID NUMBER". You output should be the same as below: Please enter a three-digit number: 1 NOT VALID NUMBER Please Enter a three-digit number: 12 NOT VALID NUMBER Please Enter a three-digit number: 1234 NOT VALID NUMBER Please Enter a three-digit number: 100 The number 100 is divisible by 2 and 5 Please Enter a three-digit number: 214 The number 214 is divisible by 2 and not 5 Hint 1: rem(X.3) and rem(X,5) or mod (X.3) and mod (X,5) Hint 2: The input should be strictly a 3-digit number like (135). Check that the entered number is a valid 3-digit number, if it is not valid print "NOT VALID NUMBER". You output should be the same as below: Please enter a three-digit number: 1 NOT VALID NUMBER Please enter a three-digit number: 12 NOT VALID NUMBER Please enter a three-digit number: 1234 NOT VALID NUMBER Please enter a three-digit number: 100 The number 100 is divisible by 2 and 5 Please Enter a three-digit number: 214 The number 214 is divisible by 2 and not 5 Please enter a three-digit number: 215 The number 215 is divisible by 5 and not 2 Please enter a three-digit number: 123 The number 123 is neither divisible by 2 nor 5 Click Sand Co

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!