-
Notifications
You must be signed in to change notification settings - Fork 2
/
test.c
61 lines (31 loc) · 879 Bytes
/
test.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/*Programmer Chase Singhofen
Date 10/8/16
Specifications: Ask the user to enter test scores.
When they have entered all the tests scores,
they will enter the value of -1. The Program
will sum up all the scores entered, and output sum.
70, 80, 90, -1. Expected 240*/
#include<stdio.h>
#include<stdlib.h>
main() {
int score, sum = 0, count = 0, grades = 0;
printf("Enter a test score(-1 to quit):");
scanf_s("%i", &score);
while (score != -1) {
sum = sum + score;
printf("Enter a test score(-1 to quit):");
scanf_s("%i", &score);
}
printf("\nThe sum of the scores is : %i\n", sum);
{
count = count + grades;
if (score < 0 || score > 100);
else {
count = count + grades;
if (score >= 70 && score <= 100);
}
}
{
}
system("pause");
}