summaryrefslogtreecommitdiff
path: root/659/CH6/EX6.4
diff options
context:
space:
mode:
authorpriyanka2015-06-24 15:03:17 +0530
committerpriyanka2015-06-24 15:03:17 +0530
commitb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch)
treeab291cffc65280e58ac82470ba63fbcca7805165 /659/CH6/EX6.4
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 '659/CH6/EX6.4')
-rwxr-xr-x659/CH6/EX6.4/exm6_4.sce28
-rwxr-xr-x659/CH6/EX6.4/exm6_4_output.PNGbin0 -> 38092 bytes
2 files changed, 28 insertions, 0 deletions
diff --git a/659/CH6/EX6.4/exm6_4.sce b/659/CH6/EX6.4/exm6_4.sce
new file mode 100755
index 000000000..b15be970b
--- /dev/null
+++ b/659/CH6/EX6.4/exm6_4.sce
@@ -0,0 +1,28 @@
+// Example 6.4
+//A class of n students take an annual examination in m subjects.
+// A program to read the marks obtained by each student in various subjects
+// and to compare and print the total marks obtained by each of them.
+
+FIRST=360;SECOND=240;
+disp("Enter number of students and subjects");
+[n,m]=scanf("%d %d");
+for i=1:n
+ roll_number=input("Enter roll_number:");
+ total=0;
+ printf("Enter marks of %d subjects for ROLL NO %d",m,roll_number);
+ printf("[Enter each in newline]");
+ for j=1:m
+ marks=scanf("%d");
+ total=total+marks; //Compute the total
+ end
+ //print the total marks
+ printf("TOTAL MARKS =%d",total);
+ //Test for division and display it
+ if(total>=FIRST) ,
+ disp("First Division");
+ elseif(total>=SECOND)
+ disp("Second Division");
+ else
+ disp("***F A I L ***")
+ end
+end \ No newline at end of file
diff --git a/659/CH6/EX6.4/exm6_4_output.PNG b/659/CH6/EX6.4/exm6_4_output.PNG
new file mode 100755
index 000000000..9d689303c
--- /dev/null
+++ b/659/CH6/EX6.4/exm6_4_output.PNG
Binary files differ