0% found this document useful (0 votes)
18 views

Practical_Program_List_1_5

B
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)
18 views

Practical_Program_List_1_5

B
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/ 5

Experiment No -01

1. Write a PHP Program to input marks of five subjects Physics, Chemistry,


Biology, Mathematics and Computer. Calculate percentage and grade
according to following:
Percentage >= 90% : Grade A
Percentage >= 80% : Grade B
Percentage >= 70% : Grade C
Percentage >= 60% : Grade D
Percentage >= 40% : Grade E
Percentage < 40% : Grade F
2. Write a PHP Program to input basic salary of an employee and calculate its
Gross salary according to following:
Basic Salary <= 10000 : HRA = 20%, DA = 80%
Basic Salary <= 20000 : HRA = 25%, DA = 90%
Basic Salary > 20000 : HRA = 30%, DA = 95%
3. Write a PHP Program to input electricity unit charges and calculate total
electricity bill according to the given condition:
For first 50 units Rs. 0.50/unit
For next 100 units Rs. 0.75/unit
For next 100 units Rs. 1.20/unit
For unit above 250 Rs. 1.50/unit
An additional surcharge of 20% is added to the bill
4. Write a PHP Program to input cost price and selling price of a product and
check profit or loss.
************************************************************************************
Experiment No -02
5. Write a PHP Program to input all sides of a triangle and check whether
triangle is valid or not.
6. Write a PHP Program to count total number of notes in given amount.
7. Write a PHP Program to check whether a triangle is valid or not if angles
are given using if else.
8. Write a PHP Program to input amount from user and print minimum number
of notes (Rs. 500, 100, 50, 20, 10, 5, 2, 1) required for the amount.
9. Write a PHP Program to check whether a number is divisible by 5 and 11 or
not.
10. Write a PHP Program print total number of days in a month using
switch case.
11. Write a PHP Program to find maximum between two numbers using
switch case.
12. Write a PHP Program to check whether an alphabet is vowel or
consonant using switch case.
************************************************************************************
Experiment No -03

13. Write a PHP Program to input any two numbers from user and swap
values of both numbers using bitwise operator.
14. Write a PHP Program to input any number and check whether the
given number is even or odd using bitwise operator.
15. Develop a PHP program to convert decimal number to binary number.
16. Develop a PHP program to convert binary number to decimal number.
17. Write a PHP program to input a number from user and print
multiplication table of the given number using for loop.

18. Write a PHP Program to find first digit of a number

19. Write a PHP program to calculate sum of digits of a number.


20. Write a PHP program to input a number from user and find reverse of
the given number
21. Write a PHP program to input a number from user and print it into
words
22. Write a PHP program to calculate factorial of a number.
23. Write a PHP program to print Fibonacci series up to n terms.
24. Write a PHP program to convert Decimal to Octal number system.
25. Write a PHP program to print diamond star pattern series
*
* *
* * *
* * * *
* * * * *
* * * *
* * *
* *
*
26.
1
2 2
3 3 3
4 4 4 4
5 5 5 5 5

27
1
2 3
4 5 6
7 8 9 10
11 12 13 14 15
28
*****
* *
* *
* *
*****
29
*
**
* *
* *
* *
******
30
0
0 1
0 1 0
0 1 0 1

*********************************************************************************
Experiment No -04

1. PHP program to find the maximum and minimum element of an array


2. PHP program to Appending/merging of two arrays in PHP
3. PHP program to get the length of the array in PHP?
4. PHP program to Delete an element from an array in PHP
5. Create and print following array in PHP
a) Index Array b) Associative Array c) Indexed multidimensional Array
d) Associative multidimensional Array.

6. PHP program to get the only values from an associative array in PHP?
7. PHP program to sort an integer array in ascending and descending order
8. PHP program to Delete an element from an array using unset() function
9. PHP program to Delete all occurrences of an element from an array
10. PHP program to Find the occurrences of a given element in an array
11. PHP program to Check if an array is empty or not in PHP
12. Write a PHP program to perform following array operations
A) array_flip() B) Compact() C) extract() D) Implode() E) Explode()
13. Write a PHP program to perform following array operations
A) array_push() B) array_pop() C) array_shift() D) array_unshift()
14. Write a PHP program to perform following array operations

A) array_diff() B) array_product() C) array_diff_assoc() D) array_key_exists()


E) array_keys()

15. Write a PHP program to perform following array operations


A) array_replace() B) array_slice() C) array_splice() D) array_search()
16. Write a PHP program to perform following array operations

A) sort() - sort arrays in ascending order


B) rsort() - sort arrays in descending order
C) asort() - sort associative arrays in ascending order, according to the value
D) ksort() - sort associative arrays in ascending order, according to the key
E) arsort() - sort associative arrays in descending order, according to the value
F) krsort() - sort associative arrays in descending order, according to the key

**************************************************************************

Experiment No -05
a. Write a PHP program to—

i. Calculate length of string without using string function.

ii. Count the number of words in string -without using string functions.

b. Write a simple PHP program to demonstrate use of various built-in string functions.

1) ucwords()

2) str_repeat()

3) strcmp()

4)substr()

c. Write a PHP program to find number of vowels in given string

d. Write a PHP program to find number of occurrence of given character string.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy