PPS Practical 12
- Aim: Write a program to read marks from keyboard and your program should display equivalent grade according
to following table (if else ladder)
Marks Grade 100 - 80 Distinction 79 - 60 First Class 59 - 40 Second Class < 40 Fail
- Code:
//For turbo C++ remove below comments #include <stdio.h> //#include<conio.h> void main() { int marks; // clrscr(); printf("Enter marks : "); scanf("%d",&marks); if (marks>=80){ printf("Distinction"); }else if (marks>=60){ printf("First Class"); }else if (marks>=40){ printf("Second Class"); }else{ printf("Fail"); } // getch(); }
- Output:

Comments
Post a Comment