0% found this document useful (0 votes)
11 views6 pages

Experiment No 3

Write a program to demonstrate the use of looping structure using while loop do….while loop for loop

Uploaded by

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

Experiment No 3

Write a program to demonstrate the use of looping structure using while loop do….while loop for loop

Uploaded by

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

Web Application development Using PHP Experiment No.

EXPERIMENT No. 3
1.0 Title:
Write a program to demonstrate the use of looping structure using
while loop
do….while loop
for loop

2.0 Looping statement

It is conditional statements which are used to perform some part of


program again and again

3.0 New Concepts:


Proposition 1: while loop

It is entry controlled loop. Condition is tested at the entry of body of loop.

Syntax: while(test-condition)

Body of loop

Proposition 2: do….while loop

It is entry controlled loop. Condition is tested at the end of body of loop.

Syntax:

do{

body of loop

while(test-condition);

Proposition 3 for loop

It is entry controlled and more concise loop control structure

Syntax: for(initialization; test-condition; increment-section )

Body of loop

Maharashtra State Board of Technical Education


Web Application development Using PHP Experiment No.3

4.0 Learning Objectives:

Intellectual Skills:
1. To understand the use of while loop
2. To understand the use of do…..while loop
3. To understand the use of for loop
4. To use looping structure to solve given problem

Motor Skills:
1. Ability to use looping statements to solve given problem.
2. Ability to use PHP web servers.

5.0 Apparatus:

Srno Equipment Name with broad specification Practical

1 Hardware : any computer system (preferably i3 or i5) All

2 Operating System: Windows/Linux All

3 Any Database tool such as MYSQL,MariaDB 15,16

6.0 Observation:

Write syntax and use of foreach statement.


………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………

Maharashtra State Board of Technical Education


Web Application development Using PHP Experiment No.3

7.0 Questions for confirmation of learning:


Student shall write answers to the questions in laboratory independently.
They may use or refer to the notes etc.Teacher shall supervise.
1 Write a program to find factorial of number

………………………………………………………………………………………………
………………………………………………………………………………………………
……………………….…….……………………………………………………………….
.……………………………………………………………………………………………..
………………………………………………………………………………………………

………………………………………………………………………………………………

………………………………………………………………………………………………

………………………………………………………………………………………………

………………………………………………………………………………………………

………………………………………………………………………………………………

………………………………………………………………………………………………

………………………………………………………………………………………………

2 Write PHP program to print Fibonacci series

………………………………………………………………………………………………
……………………….…….……………………………………………………………….
.……………………………………………………………………………………………..
………………………………………………………………………………………………
………………………………………………………………………………………………

8.0 Student Activity:


Teacher shall form two groups of students.
Each group shall perform only one allotted activity from the following.
Teacher shall supervise.
1. Write a program to find sum of digits of a given number
2. Write a program to print reverse of number
3. Write the program to print even numbers upto 10 and sum of them
4. Write a program to find average of first 10 natural numbers using for loop
5. Write a program to print prime numbers upto n
9.0 Result

 Solved the problem based on condition using decision looping control


statements.

Maharashtra State Board of Technical Education


Web Application development Using PHP Experiment No.3

(Space for Answers)


(Student shall attach separate sheet if needed)

………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………

Maharashtra State Board of Technical Education


Web Application development Using PHP Experiment No.3

………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
…………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
…………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………

………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
…………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………

Maharashtra State Board of Technical Education


Web Application development Using PHP Experiment No.3

………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
…………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………

Marks 15 15 10 5 5 50 Dated
Signature
Obtained

Date: Signature

Maharashtra State Board of Technical Education

You might also like