+ All Categories
Home > Documents > 4-7 sesson.doc

4-7 sesson.doc

Date post: 13-Sep-2015
Category:
Upload: satish-maharajan
View: 213 times
Download: 0 times
Share this document with a friend
Popular Tags:
143
YMT College of Management Session 4 Assignment 1: Demonstrate the use of Local and Global Variables in PHP. local_global.php <html> <body> <?php echo "It is Example of Local and Global variables."; $x=10; $z=5; function Add() { $y=4; global $z; $p=$y+$z; echo "<br>"; echo "y is local variable"; echo "<br>"; echo "value of y is:$y"; echo "<br>"; echo "Addition of y and Z is:$p"; } echo "<br>"; echo "<br>"; echo "Here x any Z are Global variables."; echo "<br>"; echo "value of x is:$x"; echo "<br>"; echo "Value of z is:$z"; echo "<br>"; Add(); echo "<br>"; echo "<br>"; echo "value of x is:$x"; echo "<br>"; 1
Transcript

YMT College of Management

YMT College of Management

Session 4Assignment 1:

Demonstrate the use of Local and Global Variables in PHP.

local_global.php

OUTPUT:

Assignment 2:

Demonstrate the use of Constants in PHP.

OUTPUT: Assignment 3: Demonstrate the use of all operators in PHP.

Arithmatic Operator

OUTPUT:

Array equality Operator:

OUTPUT:

Array union Operator:

OUTPUT:

Assignment Operator

Output:

Comparison Operator

Constant Operator

Output:

Increment and Decrement Operator

Output:

Logical Operator

Output:

String Operator

Output:

Assignment 4:

Demonstrate the use of control structure.Break control structure

break.php

OUTPUT:

Continue control structurecontinue.php

Continue statement

OUTPUT:

dowhile.php

foreach.php

For each

forloop.php

If else statementif2.php

If else statement

OUTPUT:

If else statement with greetingif_else.php

OUTPUT:

If else else if statement with greetingif_elseif.php

If else elseif statement with greeting

Switch caseswitch1.php

OUTPUT

Switch caseSwitch2.php

While loop

while_loop1.php

OUTPUT:

While loop

while_loop2.php

OUTPUT:

Assignment: 05

Write a programme to find factorial of number.

Output

Assignment: 06

Write a program to take a number and check whether it is factorial of any number or not?

factorial Example

Assignment: 08

Write a programme to convert currency or temperature.

Converter

Temperature Converter

Enter Temperature :


Recommended