-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.c
53 lines (45 loc) · 1.44 KB
/
main.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
#include <stdio.h>
int main(void)
{
int p = 0;
int f = 0;
int t = 0;
char userInput;
char pass;
char fail;
p = 0;
f = 0;
t = 0;
pass = 'y';
fail = 'n';
printf("Was it pass or fail? (type 'y' for YES, 'n' for NO and 'q' to quit):\n\n");
scanf("%c", &userInput);
while (userInput != 'q')
{
//system("cls"); /* == To clean screen of the console == */
if (userInput == pass)
{
system("cls"); /* == To clean screen of the console == */
printf("Was it pass or fail? (type 'y' for YES, 'n' for NO and 'q' to quit):\n\n");
p++;
t = p + f;
printf("Passed Parts: %d\n", p);
printf("Failed Parts: %d\n", f);
printf("Total Parts Tested: %d\n\n", t);
//printf("Was it pass or fail? (type 'y' for YES, 'n' for NO and 'q' to quit):\n\n");
}
if (userInput == fail)
{
system("cls"); /* == To clean screen of the console == */
printf("Was it pass or fail? (type 'y' for YES, 'n' for NO and 'q' to quit):\n\n");
f++;
t = p + f;
printf("Passed Parts: %d\n", p);
printf("Failed Parts: %d\n", f);
printf("Total Parts Tested: %d\n\n", t);
//printf("Was it pass or fail? (type 'y' for YES, 'n' for NO and 'q' to quit):\n\n");
}
scanf("%c", &userInput);
}
return 0;
}