Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- ---------------------------------------------------------------------------------
- Method 1
- ---------------------------------------------------------------------------------
- */
- #include <stdio.h>
- int main(void)
- {
- int marks, sum = 0, modCount = 1, stdCount = 1, high = 0, highstd = 0;
- while (stdCount <= 3)
- {
- while (modCount <= 4)
- {
- printf("Enter Student 0%d Module %d Marks: ", stdCount, modCount);
- scanf("%d", &marks);
- sum = sum + marks;
- modCount++;
- }
- printf("Student 0%d Total Marks = %d\n\n", stdCount, sum);
- if (high < sum)
- {
- high = sum;
- highstd = stdCount;
- }
- modCount = 1;
- sum = 0;
- stdCount++;
- }
- printf("Highest Total Marks = %d by Student %d\n", high, highstd);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement