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 /659/CH6/EX6.4 | |
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 '659/CH6/EX6.4')
-rwxr-xr-x | 659/CH6/EX6.4/exm6_4.sce | 28 | ||||
-rwxr-xr-x | 659/CH6/EX6.4/exm6_4_output.PNG | bin | 0 -> 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 Binary files differnew file mode 100755 index 000000000..9d689303c --- /dev/null +++ b/659/CH6/EX6.4/exm6_4_output.PNG |