Question
3. Write a program that will display the numbers from a user specified start number to a user specified stop number. Assume that the second
3. Write a program that will display the numbers from a user specified start number to a user specified stop number. Assume that the second number the user enters will be larger than the first number. Use iteration (for loop) to solve this problem. Run your program and verify that it operates correctly. Hint: use input function to get input from user. A sample run should look like: Enter start number = 2 Enter end number = 10 Output 2 3 4 5 6 7 8 9 10
4. Modify the program of above exercise (exercise 5) to check if the start number is a negative number, the program will start displaying numbers from 0. Hint: add if, else statement to the for loop. A sample run should look like: Enter start number = -5 Enter end number = 10 Output 0 1 2 3 4 5 6 7 8 9 10
How would I write these in Matlab?
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