Write a PHP program to check if a person is eligible to vote
Description:
Write a PHP program to check if a person is eligible to vote or not.
Condition
- Minimum age required for vote is 18.
- You can use PHP Functions.
- You can use Decision Making Statements.
Click to View Solution/Program.
<?php
function check_vote() //function has been declared
{
$name = "Rakesh";
$age = 19;
if ($age >= 18) {
echo $name . ", you Are Eligible For Vote";
} else {
echo $name . ", you are not eligible for vote. ";
}
}
check_vote(); //function has been called
?>
Tutorials Class - Output Window
You Are Eligible For Vote
Learn more about the similar topics:
Tutorials |
---|
No Content Found. |
Exercises & Assignments |
---|
Write a PHP program to check if a person is eligible to vote |
Interview Questions & Answers |
---|
No Content Found. |