Web Based Application Development with PHP
(22619) Answers
Practical 2: Write a PHP program to demonstrate the use of Decision-making control structures using-a. If statementb. If-else statementc. Switch statement
* Program code 1) Write a program to find given number is Even or OddAns=>
* Exerecise 1. Write a program to make the use of logical operators.Ans=> xample:
2. Write a program to check no is positive or negative.Ans=> xample:
3. Write a calendar program using switch statement.Ans=> xample:
* Practical Related Questions.
1. List operators used in if conditional statement.Ans=> 1) Comparison Operator. 2) Logical Operators 3) Arithmetic Operators
2. In if-else construct which part will be executed if condition is true.Ans=> 1) If the condition is true then body of if is executed.
3. State the condition when the else part will be executed with exampleAns=> 1)The code associated with the 'else' condition is only executed when no other condition has been met .2) Example :
1. Write a program to make the use of logical operators.
Ans=>
xample:
2. Write a program to check no is positive or negative.
Ans=>
xample:
3. Write a calendar program using switch statement.
Ans=>
xample:
1. List operators used in if conditional statement.
Ans=> 1) Comparison Operator.
2) Logical Operators
3) Arithmetic Operators
2. In if-else construct which part will be executed if condition is true.
Ans=> 1) If the condition is true then body of if is executed.
3. State the condition when the else part will be executed with example
Ans=>
1)The code associated with the 'else' condition is only executed when no other condition has been met .
2) Example :
Example:
....Keep Growing ❤
.
.
.
.
Keep Growing ❤
0 Comments