Semester : S1 and S2
Subject : Computer Programming
Year : 2017
Term : DECEMBER
Branch : BIOTECHNOLOGY
Scheme : 2015 Full Time
Course Code : CS 100
Page:10
Example: Write a program to read in the marks of a student and display the grade according to the following
information using else-if ladder.
Average Marks Grade
80 to 100 A
60 1௦ 79 B
50 to 59 (6
40 to 49 D
Oto 39 F(Fail).
This grading can be done using else-if ladder as follows:
if(marks > 79)
grade= 'A';
else if(marks > 59)
grade= 'B';
else if(marks > 49)
grade= 'C';
else if(marks > 39)
grade= 'D';
else
ഉദാ;
printf("Grade is %c",grade);
Program to find maximum of three numbers using else-if ladder.
main()
int a,b,c,max;
drscr();
printf("Enter values of a ,b,c");
scanf("%d%d%d" &a,&b, 80);
if(a>b && a>c)
max=a;
else if(b>c)
max=b;