Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main()
- {
- int per;
- while(1)
- {
- printf("Enter your percentage: ");
- scanf("%d", &per);
- if (per >= 100 || per<=0)
- {
- printf("Invalid percentage!\n Please retry.");
- }
- else
- break;
- }
- if (per >= 75) {
- printf("You have passed in distinction\n");
- }
- else if (per >= 60) {
- printf("You have passed in first class\n");
- }
- else if (per >= 50) {
- printf("You have passed in second class\n");
- }
- else if (per>= 40) {
- printf("you have passed in thrid class\n");
- }
- else if (per>= 35) {
- printf("You have passed\n");
- }
- else {
- printf("better luck next time\n");
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment