Last active
April 4, 2019 19:08
-
-
Save anonur/b9a4c0cda3ec1f73b196e21879dd15fd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
int main(void) | |
{ | |
unsigned int passes = 0; | |
unsigned int failures = 0; | |
unsigned int student = 1; | |
int result; | |
while(student <= 10) { | |
printf("%s","Enter result (1=pass,2=fail): "); | |
scanf("%d",&result); | |
if(result == 1) { | |
passes = passes + 1; | |
}//end if | |
else { | |
failures = failures + 1; | |
}//end else | |
student = student + 1; | |
}//end while | |
printf("Passed %u\n",passes); | |
printf("Failed %u\n",failures); | |
if(passes > 8) { | |
puts("Bonus to instructor!"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment