Generation

generate functionTue, 21 Mar 2023

realizar un script que DETERMINAR SI UN NUMERO INGRESADO A TRAVÉS DEL FORMULARIO ES UN NUMERO PAR O IMPAR con la sentencia if- else

<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Document</title> </head> <body> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"> <p> <input type="text" name="numero" placeholder="ingrese un número" > </p> <p> <input type="submit" value="verificar"> </p> </form> <?php if(isset($_POST['numero'])){ $numero = $_POST['numero']; if($numero % 2 == 0){ echo "$numero es un numero par"; } else { echo

Questions about programming?Chat with your personal AI assistant