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
Exercises & Assignments
Write a program to check student grade based on marks
Write a program to show day of the week using switch
Write a program to calculate Electricity bill in PHP
Write a simple calculator program in PHP using switch case
Write a PHP program to check if a person is eligible to vote
Write a PHP program to check whether a number is positive, negative or zero
Interview Questions & Answers
No Content Found.