To find the square of a number
Number
To find the"> To find the">

NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

<h1 align="center">To find the square of a number</h1>
<form action="4.php" method="get">
Number<input type="text" name="x">
<input type="submit" name="su">
</form>
<?php
if (!empty($_GET['su'])) {
$a= $_GET['x'];
$b= $a*$a;
echo 'Its square is '.$b.'<br/>';

}
?>

<h1 align="center">Factorial of</h1>
<form action="5.php" method="post">
Number<input type="text" name="a">
<input type="submit" name="s">
</form>
<?php
if (!empty($_POST['s'])){
$k=$_POST['a'];


$fact=1;
for ($l=$k; $l >=1 ; $l--) {
$fact=$fact*$l;
}
echo 'Factorial of '.$k.' is '.$fact;
}





?>

<h1>To identify whether the given number is prime or not?</h1>
<form action="6.php" method="get" >
Number <input type="text" name="a">
<input type="submit" name="s">

</form>
<?php
if (!empty($_GET['s']))
{
if (is_numeric($_GET['a'])) {
$n= $_GET['a'];

$c = 1;
for ($i=2; $i<$n ; $i++) {
if ( $n % $i==0)
$c++;

}
if ($c==1) {

echo $n.' is a Prime number.';
}
else {

echo $n.' is not a Prime number.';

}
}
}



?>

<h1>To find out the Compound Amount and Compound Interest </h1>
<form action="7.php" method="get">
Principal <input type="text" name="a">
Time <input type="text" name="b">
Rate <input type="text" name="c"><br>
Number of times Interest Compounded <input type="text" name="d"><br>
<input type="submit" name="s">

</form>
<?php
if (!empty($_GET['s'])) {
$p= $_GET['a'];
$t= $_GET['b'];
$r= $_GET['c'];
$n= $_GET['d'];
$a=$r/$n;
$b=$n*$t;
$g=1;
$c= $g + $a;
$d= pow($c, $a);
$e=$p*$d;
$f=$e-$p;
if ($p) {
echo 'The compount amount is '. $e;
echo '<br/>. The Compound Interest is '. $f;
}

}


?>

<h1>To find out whether the given year is leap or not</h1>
<form action="8.php" method="get">
Year <input type="text" name="a">
<input type="submit" name="s">
</form>
<?php
if (!empty($_GET['s'])) {
if (is_numeric($_GET['a'])) {
$y= $_GET['a'];
if ($y % 4 == 0) {
echo 'This year is leap.';
}

else{
echo 'This is not a leap year.';
}
}
}
?>

<h1>To arrange the given number in reverse order</h1>
<form method="get" action="9.php">
Numbers<input type="text" name="a">
<input type="submit" name="su">
</form>
<?php
if (!empty($_GET['su']))
{
$s= $_GET['a'];
for ($s=1; $s >=1 ; $s++) {

}
$s= array($l,$k,$j,$h);
echo 'The reverse is '.$s[3],$s[2],$s[1],$s[0];
}


?>

<h1 align="center">Multiplication Table Of</h1>
<form action="10.php" method="get">
Number<input type="text" name="a">
<input type="submit" name="su">
</form>
<?php
if (!empty($_GET['su'])) {
$s= $_GET['a'];
for ($i=1; $i<=10 ; $i++) {
$d=$s*$i;
echo $s.'*'.$i.'='.$d.'<br/>';
}
}
?>

<h1>To determine the greater value</h1>
<form action="11.php" method="post">
Number1 <input type="text" name="a">
Number2 <input type="text" name="b">
<input type="submit" name="s">
</form>
<?php
if (!empty($_POST['s'])) {
if (is_numeric($_POST['a'])) {
$a= $_POST['a'];
$b= $_POST['b'];
if ($a>$b) {
echo $a.' is the greater number.';
}
else{
echo $b.' is the greater number.';
}
}
}

?>

<h1>Whether you are a child or not!!</h1>
<form action="12.php" method="get.php">
Age <input type="text" name="age">
<input type="submit" name="su">
</form>
<?php
if (!empty($_GET['su'])) {
if (is_numeric($_GET['age'])) {
$a= $_GET['age'];
$b=12;
echo 'Your name is Ram.'.'<br/>';
echo 'Your address is Kathmandu.'.'<br/>';
if ($a>$b) {
echo 'Your age is '. $a.'.';

echo '<br/>'.'You are not a child.';
}
else{

echo 'Your age is '. $a .'.';

echo '<br/>'.'You are a child.';

}
}
}

?>

<h1>To reverse a given number</h1>
<form action="13.php" method="get">
Number <input type="text" name="a">
<input type="submit" name="s" value="Reverse">
</form>


<?php
if (!empty($_GET['s'])) {
$n= $_GET['a'];

$v=0;

while ( $n > 1) {
$r= $n % 10;
$v= ($v*10) + $r;
$n=$n/10;


}
echo 'Its reverse is '. $v;
}
?>
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.