summaryrefslogtreecommitdiff
path: root/1034/CH1/EX1.1/example1.sce
diff options
context:
space:
mode:
authorpriyanka2015-06-24 15:03:17 +0530
committerpriyanka2015-06-24 15:03:17 +0530
commitb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch)
treeab291cffc65280e58ac82470ba63fbcca7805165 /1034/CH1/EX1.1/example1.sce
downloadScilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.gz
Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.bz2
Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.zip
initial commit / add all books
Diffstat (limited to '1034/CH1/EX1.1/example1.sce')
-rwxr-xr-x1034/CH1/EX1.1/example1.sce23
1 files changed, 23 insertions, 0 deletions
diff --git a/1034/CH1/EX1.1/example1.sce b/1034/CH1/EX1.1/example1.sce
new file mode 100755
index 000000000..bd999a073
--- /dev/null
+++ b/1034/CH1/EX1.1/example1.sce
@@ -0,0 +1,23 @@
+//to do sorting of nos. contained in a list
+function[]=sorting(a)
+ i=1;
+ [j,k]=size(a);
+ j=i;
+ for i=1:k-1
+ for j=i:k
+ if a(i)>a(j) then
+ z=a(i);
+ a(i)=a(j);
+ a(j)=z;
+ end
+ end
+end
+for i=1:k
+ disp(a(i));
+end
+
+funcprot(0);
+endfunction
+ //callin routine
+ a=[5 7 45 23 78]
+ sort=sorting(a)