2
25. Write a program to find the division of student when percentage and criteria for division is:using function(if else if..)
PERCENTAGE
|
DIVISION
|
70-100
|
Honour
|
60-69
|
First
|
45-59
|
Second
|
33-44
|
Third
|
Below 33
|
Fail
|
Input
1. perc
Output
1. Division
Method:
1. start
2. read perc
3. print perc
4. division_fun(perc);
5.stop
//write the function definition before the main program
void division_fun(float perc)
begin
if(perc >= 70 && perc <=100)
begin
print"Honour";
end
else
if(perc >=60 && perc <= 69)
begin
print " First";
end
else
if(perc >=45 && perc <=59)
begin
print "Second";
end
else
if(perc >=33 && perc <=44)
begin
print"Third";
end
else
begin
print" Fail";
end
end
No comments:
Post a Comment