summaryrefslogtreecommitdiff
path: root/3808/CH3/EX3.1/Ex3_1.sce
diff options
context:
space:
mode:
Diffstat (limited to '3808/CH3/EX3.1/Ex3_1.sce')
-rw-r--r--3808/CH3/EX3.1/Ex3_1.sce18
1 files changed, 18 insertions, 0 deletions
diff --git a/3808/CH3/EX3.1/Ex3_1.sce b/3808/CH3/EX3.1/Ex3_1.sce
new file mode 100644
index 000000000..0b13d0d42
--- /dev/null
+++ b/3808/CH3/EX3.1/Ex3_1.sce
@@ -0,0 +1,18 @@
+//Chapter 03: Algorithms
+
+clc;
+clear;
+
+ar=[]
+max_v=0
+n=input('Enter the number of elements in the finite sequence:')
+disp('Enter the elements one after the other!')
+for i=1:n
+ ar(i)=input(' ')
+end
+for i=1:n
+ if ar(i)>max_v then
+ max_v=ar(i)
+ end
+end
+disp(max_v,'The largest element is:')