Write a program to check student grade based on marks
Description:
Write a program to check student grade based on the marks using if-else statement.
Conditions:
- If marks are 60% or more, grade will be First Division.
- If marks between 45% to 59%, grade will be Second Division.
- If marks between 33% to 44%, grade will be Third Division.
- If marks are less than 33%, student will be Fail.
Click to View Solution/Program
<?php
$marks = 40;
if ($marks>=60)
{
$grade = "First Division";
}
else if($marks>=45)
{
$grade = "Second Division";
}
else if($marks>=33)
{
$grade = "Third Division";
}
else
{
$grade = "Fail";
}
echo "Student grade: $grade";
?>
Tutorials Class - Output Window
Third Division
Learn more about the similar topics:
Tutorials |
---|
PHP Decision Making |
Interview Questions & Answers |
---|
No Content Found. |