Computer Science, asked by ksharma3668, 6 months ago


write PHP code for the following statement
A) write a
programme to calculate
factorial of a number using for
loop in php
B) write a php program to check
whether a number, is positive, negative or zero

Answers

Answered by hars909h
1

Answer:

<?php

$n = 6;

$x = 1;

for($i=1;$i<=$n-1;$i++)

{

$x*=($i+1);

}

echo "The factorial of $n = $x"."\n";

?>

Explanation:

pls mark my answer as brainliest

Similar questions