Question: Matlab Problem 2 Write a MATLAB program that asks the user to enter a positive integer number, of unknown number of digits, and calculates a.
Problem 2 Write a MATLAB program that asks the user to enter a positive integer number, of unknown number of digits, and calculates a. The number of the digits b.The sum of all digits. Output: Enter any number: 6234 Number of digits = 4 Sum of all digits = 15 Enter any number :123 Number of digits = 3 Sum of all digits = 6 Enter any number: -123 Invalid input! Re-Enter any number: 123.5 Invalid input! Re-Enter any number: 1235 Number of digits = 4 Sum of all digits = 11
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
