8 write the php programs to do the following a implement simple calculator operations

8. WRITE THE PHP PROGRAMS TO DO THE FOLLOWING:

A. IMPLEMENT SIMPLE CALCULATOR OPERATIONS.
B. FIND THE TRANSPOSE OF A MATRIX.
C. MULTIPLICATION OF TWO MATRICES.
D. ADDITION OF TWO MATRICES.


 SOLUTION  1  &  SOLUTION  2 

If xampp is in the system, save the program in C:\xampp\htdocs (start apache in xampp control panel)

If no xampp in the system, save the program in C:\Program Files\Apache Group\Apache2\htdocs   & Open Google Chrome & type http://localhost/prog8a.php

prog8a.php



















if(isset($_POST['submit'])) // it checks if the input submit is filled
{
$num1 = $_POST['num1'];
$num2 = $_POST['num2']; 
if(is_numeric($num1) and is_numeric($num2) )
{
echo "
"; 
echo ""; 
echo ""; 
echo "";
echo "

SIMPLE CALCULATOR

First Number:
Second Number:
Addition :

".($num1+$num2)."

Subtraction :

".($num1-$num2)."

Multiplication :

".($num1*$num2)."

Division :

".($num1/$num2)."

";

}
else
{
echo"";
}
}
?>



STEPS :( click on image to zoom )

8 write the php programs to do the following a implement simple calculator operations



OUTPUT :( click on image to zoom )

Description:

You need to write a simple calculator program in PHP using switch case.

Operations:

  • Addition
  • Subtraction
  • Multiplication
  • Division

View Solution/Program


 

	Simple Calculator Program in PHP - Tutorials Class

 

 

    

PHP - Simple Calculator Program

First Number

Second Number

Result

Tutorials Class - Output Window

8 write the php programs to do the following a implement simple calculator operations


Learn more about the similar topics:

Tutorials
PHP Decision Making
Exercises & Assignments
Write a program to check student grade based on marks
Write a program to show day of the week using switch
Write a program to calculate Electricity bill in PHP
Write a simple calculator program in PHP using switch case
Write a PHP program to check if a person is eligible to vote
Write a PHP program to check whether a number is positive, negative or zero
Interview Questions & Answers
No Content Found.