diff options
author | priyanka | 2015-06-24 15:03:17 +0530 |
---|---|---|
committer | priyanka | 2015-06-24 15:03:17 +0530 |
commit | b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch) | |
tree | ab291cffc65280e58ac82470ba63fbcca7805165 /662/CH7/EX7.9 | |
download | Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.gz Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.bz2 Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.zip |
initial commit / add all books
Diffstat (limited to '662/CH7/EX7.9')
-rwxr-xr-x | 662/CH7/EX7.9/ex7_9.sci | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/662/CH7/EX7.9/ex7_9.sci b/662/CH7/EX7.9/ex7_9.sci new file mode 100755 index 000000000..8332df5b2 --- /dev/null +++ b/662/CH7/EX7.9/ex7_9.sci @@ -0,0 +1,27 @@ + //Programming Example 7.9
+//determine the largest of three integer quantities
+
+function[z] = maximum(x ,y)
+ if (x >= y) then
+ z = x;
+ else
+ z = y;
+ end
+endfunction
+
+function[] = main()
+//read the integer quantities
+printf("\nEnter integer quantities ");
+ printf("\na= ");
+ a= scanf("%d");
+ printf("\nb= ");
+ b= scanf("%d");
+ printf("\nc= ");
+ c= scanf("%d");
+//calculate and display the maximum value
+ d = maximum(a,b);
+ printf("\n\nmaximum = %d ", maximum(c,d));
+endfunction
+
+//calling main function.
+main();
|