0% found this document useful (0 votes)
18 views4 pages

Practical-12: Name:Manish Singh Course: Bca ROLLNO: 23041208 DATE: 20/11/2024

It is the python coding example.

Uploaded by

Unknown Person
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views4 pages

Practical-12: Name:Manish Singh Course: Bca ROLLNO: 23041208 DATE: 20/11/2024

It is the python coding example.

Uploaded by

Unknown Person
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Practical-12

NAME:MANISH SINGH
COURSE: BCA
ROLLNO: 23041208
DATE: 20/11/2024

Aim: WAP in php to demostrate different type of operator


Procedure:
<html>
<head>
<title>Practical 12</title>
</head>
<body>
<?php
$a = 10;
$b = 5;
echo "Arithmetic Operators:<br>";
echo "a + b = " . ($a + $b) . "<br>";
echo "a - b = " . ($a - $b) . "<br>";
echo "a * b = " . ($a * $b) . "<br>";
echo "a / b = " . ($a / $b) . "<br>";
echo "a % b = " . ($a % $b) . "<br>";
echo "a ** b = " . ($a ** $b) . "<br>";
echo "<br>";
$c = 20;
echo "Assignment Operators:<br>";
echo "Initial value of c: $c<br>";
$c += 5;
echo "c += 5 -> $c<br>";
$c -= 5;
echo "c -= 5 -> $c<br>";
$c *= 2;
echo "c *= 2 -> $c<br>";
$c /= 2;
echo "c /= 2 -> $c<br>";
$c %= 3;
echo "After %= 3: c = $c<br>";
echo "<br>";
$d = 10;
$e = 20;
echo "Comparison Operators:<br>";
echo "d == e: " . ($d == $e ? 'True' : 'False') . "<br>";
echo "d != e: " . ($d != $e ? 'True' : 'False') . "<br>";
echo "d > e: " . ($d > $e ? 'True' : 'False') . "<br>";
echo "Is d less than e? " . ($d < $e ? 'True' : 'False') . "<br>";
echo "Is d greater than or equal to e? " . ($d >= $e ? 'True' : 'False') . "<br>";
echo "Is d less than or equal to e? " . ($d <= $e ? 'True' : 'False') . "<br>";
echo "<br>";
$f = true;
$g = false;
echo "Logical Operators:<br>";
echo "f AND g: " . ($f && $g ? 'True' : 'False') . "<br>";
echo "f OR g: " . ($f || $g ? 'True' : 'False') . "<br>";
echo "NOT f: " . (!$f ? 'True' : 'False') . "<br>";
echo "<br>";
$firstName = "John";
$lastName = "Doe";
$fullName = $firstName . " " . $lastName;
echo "String Operators:<br>";
echo "Full Name: " . $fullName . "<br>";
$fullName .= " Jr.";
echo "Full Name after concatenation: " . $fullName . "<br>";
?>
</body>
</html>

Output:

You might also like