-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathassignment.php
More file actions
61 lines (46 loc) · 1.18 KB
/
assignment.php
File metadata and controls
61 lines (46 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<?php
/**
* Topic: Assignment Operators
* Author: Muhammad Afzal
* Class: e-Rozgaar Batch#11
* Date: 5th Jan 2021
*/
#Define BR Constant
define("BR","<br />");
//Declare Variables
$a=20;
$b=10;
echo "Value of a=".$a.BR;
echo "Value of b=".$b.BR;
//Basic Assignment Operation
$a=$b;
echo "After Basic Assignment Value of a=b =".$a.BR;
//Addition
echo "Value of a=".$a.BR;
echo "Value of b=".$b.BR;
$a+=$b;
echo "After Addition Assignment Value of a+=b =".$a.BR;
//Subtraction
echo "Value of a=".$a.BR;
echo "Value of b=".$b.BR;
$a-=$b;
echo "After Subtraction Assignment Value of a-=b =".$a.BR;
//Multiply
echo "Value of a=".$a.BR;
echo "Value of b=".$b.BR;
$a*=$b;
echo "After Multiply Assignment Value of a*=b =".$a.BR;
//Division
echo "Value of a=".$a.BR;
echo "Value of b=".$b.BR;
$a/=$b;
echo "After Division Assignment Value of a/=b =".$a.BR;
//Products Fetched From DB 18
//Row =4
//Mod/Reminder
$value1=33;
$value2=5;
$value1%=$value2;
echo "Reminder of 33%2= ".$value1;
echo BR.BR.BR.BR;
?>