Computer Science, asked by deys9081, 11 months ago

Write a program in PHP to check whether the person is adult Orr not

Answers

Answered by NasifFuad07790
0

Answer:

Here

Explanation:

<?

if(person<=18){

echo "You are not adult"

}else{

echo"You are adult"

}

Answered by AskewTronics
0

Below are the program in php for the above problem:

Explanation:

<?php

$personage=88;// Initialize a variable with a value, the value can also take by the help of HTML form.

if($personage>18) //check the if condition for age is greater than 18 or not.

echo "A person is an adult person"; //print for adult.

else

echo"The person is not an adult person"; //print if a person is not adult.

?>

Output:

  • The above code output that "A person is an adult person".
  • But when the value of personage variable will be changed to 18, then it will prints that "The person is not an adult person".

Code Explanation:

  • The above code is in the PHP language. There is a variable that takes static value.
  • But this program will work for a different dynamic value.
  • The value can be inserted by the HTML code.
  • Then the program checks that the age is an adult age or not with the help of if-else statement.

Learn more:

  • PHP : https://brainly.in/question/5829839

Similar questions