-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.m
48 lines (42 loc) · 1.29 KB
/
main.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
% Main fuction - finding largest of three numbers
%-------------------------------------------------------------------------
%-------------------------------------------------------------------------
% DEMO:
%a=8;
%b=9;
%c=2;
while true
%-------------------------------------------------------------------------
% Input your matrix:
prompt= 'Enter the first Number : ';
a=input(prompt);
prompt= 'Enter the second Number : ';
b=input(prompt);
prompt= 'Enter the third Number : ';
c=input(prompt);
%-------------------------------------------------------------------------
disp(' Finding Largest/Smallest of 3 Numbers:');
disp(' ----------------------------');
disp('1. Largest ');
disp('2. Smallest');
prompt= 'Enter your choise: ';
ch=input(prompt);
switch(ch)
case 1
out=largest(a,b,c);
case 2
out=smallest(a,b,c);
otherwise
disp('Error!!!!!!');
end
%------------------------------------------------------------------------
% Output
disp('Output :');
disp(out);
%-------------------------------------------------------------------------
prompt='\n Do you want to continue y/n:';
i=input(prompt,'s');
if (i=='n')
break;
end
end