Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void main()
- {
- clrscr();
- char c;
- int nof,grace(0);
- cout << "Enter your class(f - first/s - second/t - third): ";
- cin >> c;
- cout << endl << "\nEnter the number of failed subjects: ";
- cin >> nof;
- switch(c)
- {
- case 'f':
- grace = nof>3?0:3;
- break;
- case 's':
- grace = nof>2?0:4;
- break;
- case 't':
- grace = nof!=1?0:5;
- break;
- }
- if(grace==0)
- cout << endl << "\nYou are not eligible for grace marks.\n";
- else
- cout << endl << "\nYou get " << grace << " marks per subject as grace.\n";
- getch();
- }
Advertisement
Add Comment
Please, Sign In to add comment