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

WT Week1

The document outlines an experiment to create a PHP script that prints prime numbers between 1 and 50. It includes the aim, objectives, resources, program logic, procedure for execution, and the source code. Additionally, it lists a series of viva questions related to PHP programming concepts and practices.

Uploaded by

jaganmohan.csd
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)
11 views4 pages

WT Week1

The document outlines an experiment to create a PHP script that prints prime numbers between 1 and 50. It includes the aim, objectives, resources, program logic, procedure for execution, and the source code. Additionally, it lists a series of viva questions related to PHP programming concepts and practices.

Uploaded by

jaganmohan.csd
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

EXPERIMENT:1

1. AIM: Write a PHP script to print prime numbers between1-50.

OBJECTIVE:

To print prime numbers between1-50.

RESOURCES:

NOTEPAD++, 1GB RAM, Hard Disk 80 GB

PROGRAM LOGIC:

1. Create a PHP file.


2. Read a number in one text field and display that number name in another text field.
3. Include the JavaScript to convert number into words.
ssdder
PROCEDURE:

To execute a html program:


1. Open Notepad++ and Save the PHP program in “SREYAS” folder in drive.
3. To run the html file open the browser and type the following URL directory name/filename.

SOURCE CODE:

<?php
$num = 1 ;
while ($num <50 ) {
$count=0;
for ( $i=1;$i<=$num;$i++) {
if (($num%$i)==0) {
$count++;
}
}
if ($count<3) {
echo " Prime Number --> " .$num. " <br/>";
} $num=$num+1;
}
?>
OUTPUT:

VIVA QUESTIONS

1. Who do we know as the father of PHP?

2. What did the acronym PHP originally stand for?

3. What are some of the common applications of PHP?

4. What is the recommended PHP version?

5. Which programming language is PHP similar to?

6. What is the PHP scripting engine called?

7. What is the main difference between PHP4 and PHP5?

8. Is PHP a case sensitive language?

9. What are the popular frameworks in PHP?

10. Name the popular Content Management Systems (CMS) in PHP.


11. What is PEAR in PHP?

12. What is the difference between static and dynamic websites?

13. What are the characteristics of PHP variables?

14. What are the rules for naming a PHP variable?

15. What are the rules to determine the "truth" of any value not already of the Boolean
type?

16. What is NULL?

17. How do you define a constant in PHP?

18. What is the purpose of the constant() function?

19. What are the differences between PHP constants and variables?

20. What is the purpose of the break and continue statement?

21. What are the two most common ways to start and finish a PHP code block?

22. What is the meaning of a final class and a final method?

23. How can you compare objects in PHP?

24. What are constructors and destructors in PHP?

25. Explain the syntax for the 'for each' loop with an example.

26. What is the difference between single quoted string and double quoted string?
27. How to concatenate two strings in PHP?

28. What is the difference between "echo" and "print" in PHP?

29. Name some of the functions in PHP.

You might also like