Skip to content

Commit 53bf0b5

Browse files
authored
Create print lower to upper rang numners.m
1 parent 1153228 commit 53bf0b5

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

print lower to upper rang numners.m

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
%{
2+
Write a MATLAB program that will display the numbers from a user specified start
3+
number to a user specified stop number. Assume that the second number the user
4+
enters will be larger than the first number. Use iteration (for loop) to solve this problem.
5+
Run your program and verify that it operates correctly. A sample run should look like:
6+
Enter number 1: 4
7+
Enter number 2: 9
8+
1 2 3 4
9+
2 3 4 5 6 7 8 9
10+
%}
11+
12+
num1 = input('1st Qus START Num: ');
13+
num2 = input('End Num: ');
14+
15+
for num = num1:num2
16+
disp(num);
17+
end

0 commit comments

Comments
 (0)