0

Hi everyone.

My assignment this time requires me to:

1. List down the marks obtained for each 5 Quizzes.

2. Choose the best 2 highest marks out of the 5 Quizzes.

3. To make the "best 2 highest marks" becomes the ultimate Quizzes total mark which has a 10% carrying mark as part of the Coursework mark for the subject.

So my solution answer is down here:

#include <stdio.h>
main()
{
int mark 1, mark 2, mark 3, mark 4, mark 5, The best 2 highest marks;
printf("Enter your Quiz 1 mark:");
scanf("%d", & mark 1);
printf("Enter your Quiz 2 mark:");
scanf("%d", & mark 2);
printf("Enter your Quiz 3 mark:");
scanf("%d", & mark 3);   
printf("Enter your Quiz 4 mark:");
scanf("%d", & mark 4);  
printf("Enter your Quiz 5 mark:");
scanf("%d", & mark 5); 
The best 2 highest marks = mark > 50 + mark > 50
if ( mark > 50 ){
printf (" mark > 50 ");
else {
printf (" the mark is not one of the best 2 highest marks ");
}
return 0;
}

Can anyone tell me if I've done this right, or wrong? Please and thanks in advance (^_^)

Edited by UNDER-18 FG: n/a

3
Contributors
2
Replies
4
Views
5 Years
Discussion Span
Last Post by WaltP
0

int mark 1, mark 2, mark 3, mark 4, mark 5, The best 2 highest marks;

space is not used in variable name declaration

The best 2 highest marks = mark > 50 + mark > 50

This is not how you use an operation statement

if ( mark > 50 ){
printf (" mark > 50 ");
else {
printf (" the mark is not one of the best 2 highest marks ");
}

mark is not initialized

Did you compile your work cause you can see most of your errors there

Edited by zeroliken: n/a

0

Your C syntax is completely wrong.
Nowhere in your code do you even attempt to find the 2 highest marks.

So, no, you have not done it right.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.