![]() |
Samacheer Kalvi 12th Computer Applications Chapter 6 PHP Conditional Statements Notes PDF Download: Tamil Nadu STD 12th Computer Applications Chapter 6 PHP Conditional Statements Notes |
Samacheer Kalvi 12th Computer Applications Chapter 6 PHP Conditional Statements Notes PDF Download: Students of class can download the Samacheer Kalvi 12th Computer Applications Chapter 6 PHP Conditional Statements Notes PDF Download from our website. We have uploaded the Samacheer Kalvi 12th Computer Applications Chapter 6 PHP Conditional Statements notes according to the latest chapters present in the syllabus. Download Samacheer Kalvi 12th Computer Applications Chapter 6 PHP Conditional Statements Chapter Wise Notes PDF from the links provided in this article.
Samacheer Kalvi 12th Computer Applications Chapter 6 PHP Conditional Statements Notes PDF Download
We bring to you specially curated Samacheer Kalvi 12th Computer Applications Chapter 6 PHP Conditional Statements Notes PDF which have been prepared by our subject experts after carefully following the trend of the exam in the last few years. The notes will not only serve for revision purposes, but also will have several cuts and easy methods to go about a difficult problem.
Board |
Tamilnadu Board |
Study Material |
Notes |
Class |
Samacheer Kalvi 12th Computer Applications |
Subject |
12th Computer Applications |
Chapter |
Chapter 6 PHP Conditional Statements |
Format |
|
Provider |
How to Download Samacheer Kalvi 12th Computer Applications Chapter 6 PHP Conditional Statements Notes PDFs?
- Visit our website - https://www.samacheerkalvibook.com/
- Click on the Samacheer Kalvi 12th Computer Applications Notes PDF.
- Look for your preferred subject.
- Now download the Samacheer Kalvi 12th Computer Applications Chapter 6 PHP Conditional Statements notes PDF.
Download Samacheer Kalvi 12th Computer Applications Chapter 6 PHP Conditional Statements Chapterwise Notes PDF
Students can download the Samacheer Kalvi 12th Computer Applications Chapter 6 PHP Conditional Statements Notes PDF from the links provided in this article.
PART – I
I. Choose The Correct Answer
Question 1.
What will be the output of the following PHP code?
<?php
$x;
if ($x) print “hi”;
else
print “how are u”;?>
(a) how are u
(b) hi
(c) error
(d) no output
Answer:
(c) error
Question 2.
What will be the output of the following PHP code?
<?php
$x = 0;
if ($x++)
print “hi”;
else
print “how are u”;
?>
(a) hi
(b) no output
(c) error
(d) how are u
Answer:
(d) how are u
Question 3.
What will be the output of the following PHP code?
<?php
$x;
if ($x = 0)
print “hi”;
else
print “how are u”;
print “hello”
?>
(a) how are uhello
(b) hihello
(c) hi
(d) no output
Answer:
(d) no output
Question 4.
Statement which is used to make choice between two options and only option is to be performed is written as
(a) if statement
(b) if else statement
(c) then else statement
(d) else one statement
Answer:
(b) if else statement
Question 5.
What will be the output of the following PHP code?
<?php
$a =“”;
if ($a)
print “all”;
if
else
print “some”;
?>
(a) all
(b) some
(c) error
(d) no output
Answer:
(c) error
Question 6.
What will be the output of the following PHP code?
<?php
$a = “”;
if ($a)
print “all”;
if
else
print “some”;
?>
(a) all
(b) some
(c) error
(d) no output
Answer:
(c) error
Question 7.
What will be the output of the following PHP code?
<?php
$x = 10;
$y = 20;
if ($x > $y + $y != 3)
print “hi”;
else
print “how are u”;
?>
(a) how are u
(b) hi
(c) error
(d) no output
Answer:
(b) hi
Question 8.
What will be the output of the following PHP code?
<?php
$x = 10;
$y = 20;
if ($x > $y && 1||1)
print “hi” ;
else
print “how are u”;
?>
(a) how are u
(b) hi
(c) error
(d) no output
Answer:
(b) hi
Question 9.
What will be the output of the following PHP code?
<?php
if (-100)
print “hi”;
else
print “how are u”;
?>
(a) how are u
(b) hi
(c) error
(d) no output
Answer:
(b) hi
PART – II
II. Short Answer
Question 1.
Define Conditional Statements in PHP?
Answer:
- Conditional statements are the set of commands used to perform different actions based on different conditions.
- Conditional statements are useful for writing decision-making logics.
Question 2.
Define if statement in PHP?
Answer:
If a statement executes a statement or a group of statements if a specific condition is satisfied as per the user expectation.
Syntax: if (condition)
{
Execute statement(s) if condition is true;
}
Question 3.
What is an if-else statement in PHP?
Answer:
- If a statement executes a statement or a group of statements if a specific condition is satisfied by the user expectation.
- When the condition gets false (fail) the else block is executed.
Question 4.
List out Conditional Statements in PHP?
Answer:
if Statement
- if…else Statement
- if…else if….else Statement
- switch Statement
Question 5.
Write Syntax of the If else statement in PHP?
Answer:
if (condition)
{
Execute statement(s) if condition is true;
}
else
{
Execute statement(s) if condition is false;
}
Question 6.
Define if…else if….else Statement in PHP?
Answer:
- If-else if-else statement is a combination of if-else statement.
- More than one statement can execute the condition based on user needs.
Question 7.
Usage of Switch Statement in PHP?
Answer:
- The switch statement is used to perform different actions based on different conditions.
- It works the same as if statements but they can check for multiple values at a time.
Question 8.
Write Syntax of Switch statement?
Answer:
switch (n) {
case label 1:
code to be executed if n=label 1; break; case label2:
code to be executed if n=label2; break; case label3:
code to be executed if n=label3; break;
default:
code to be executed if n is different from all labels;
Question 9.
Compare if and if else statement?
Answer:
If:
If statement executes a statement or a group of statements if a specific condition is satisfied as per the user expectation. When the condition fails, nothing happens.
If else:
If a statement executes a statement or a group of statements if a specific condition is satisfied by the user expectation. When the condition gets false (fail) the else block is executed.
PART – III
III. Explain in Brief Answer
Question 1.
Write the features Conditional Statements in PHP?
Answer:
- The if, if…else and if…elseif…else constructs are one of the most important features of many languages including PHP
- Conditional statements provide us different actions for the different conditions.
- When we write code, we perform different actions for different decisions. Like any other language, PHP is built out of a series of control statements. The control statement can be an assignment, a function call, a loop, a conditional statement or even a statement that does nothing or an empty I statement.
Question 2.
Write the purpose of if elseif else statement?
Answer:
- If statement executes a statement or a group of statements if a specific condition is satisfied by the user expectation. When the condition gets false (fail) the else block is executed.
- If-elseif-else is a combination of if-else statement.
- More than one statement can execute the condition based on user needs.
- User can select from many choices.
Question 3.
Differentiate Switch and if else statement?
Answer:
Switch:
- Switch statement uses single expression for multiple choices.
- If all the cases are not matched default will be executed.
- It test only for equality.
- It evaluates only for character or integer
If-else:
- If else statement uses multiple statement for multiple choices.
- Nothing happens.
- It tests for equality as well as for logical ‘ expressions.
- any data type is allowed.
Question 4.
Write Short notes on Switch statement?
Answer:
- The switch statement is used to perform differ-ent actions based on different conditions.
- Switch statement test only for equality.
- Switch statement execute one case after another till a break statement appears or the end of the switch statement is reached.
Question 5.
Differentiate if statement and if elseif else statement?
Answer:
if elseif else statement:
- If-elseif-else statement is a combination of if-else statement. .
- More than one statement can execute the condition based on user needs.
- If the condition is false more alternatives are there.
PART – IV
IV. Explain in detail
Question 1.
Explain Function Conditional Statements in PHP?
Answer:
PHP Conditional Statements:
Conditional statements are useful for writing decision-making logics.
It is most important feature of many programming languages, including PHP, They are implemented by the following types:
- if Statement
- if…else Statement
- if…elseif….else Statement
- switch Statement
if Statement:
The If statement contains boolean expression Inside brackets followed by a single or multi-line code block.
if-else Statement:
- if-else Statement also provides for a second part to the if statement, that is else.
- The else statement must follow if or else if : statement.
if…eiseif….else Statement
- If-eiseif-eise statement is a combination of if-else statement.
- More than one statement can execute the condition based on user needs.
Switch statement:
Switch statement execute one case after an¬other till a break statement appears or the end of switch statement is reached.
Question 2.
Discuss in detail about Switch statement with an example?
Answer:
Switch Case:
- The switch statement is used to perform different actions based on different conditions.
- Switch statement tests only for equality.
- More case values can be given.
- When all the case values are not matched, then default will be executed.
Syntax:
switch (n) {
case label 1:
code to be executed if n=labe11;
break;
case labe12:
code to be executed if n=labe12;
break;
case labe13:
code to be executed if n=labe13; ,
break;
…….
default:
code to be executed if n is different from all labels;
}
Question 3.
Explain the process of Conditional Statements in PHP?
PHP Conditional statements:
Answer:
- PHP lets programmers evaluate different conditions during of a program and take decisions based on whether these conditions evaluate to true or false
- These conditions and the actions associated with them are expressed by means of programming construct called conditional statements.
- Conditional statements are the set of commands used to perform different actions based on different conditions.
- It is most important feature of many programming languages, including PHP, They are implemented by the following types:
- if Statement
- if…else Statement
- if…eiseif….else Statement » switch Statement
if Statement:
The if statement contains boolean expression inside brackets followed by a single or multi line code block.
if-else Statement:
- if-else Statement also provides for a second part to the if statement, that is else.
- The else statement must follow if or else if statement.
if…elseif….else Statement
- If-elseif-else statement is a combination of if-else statement.
- More than one statement can execute the condition based on user needs.
Switch statement:
Switch statement execute one case after another till a break statement is appeared or the end of switch statement is reached.
Question 4.
Explain concepts of if elseif else statement?
Answer:
If elseif else statement in PHP:
If-elseif-else statement is a combination of if-else statement. More than one statement can execute the condition based on user needs.
Syntax:
if (1st condition)
{
Execute statement(s) if condition is true;
}
elseif(2nd condition)
{
Execute statement(s) if 2nd condition is true;
}
else
{
Execute statement(s) if both conditions are false;
}
Example:
<?php
$Pass_Mark=35;
$first_class=60;
$Student_Mark=70;
if ($Student_Mark>= $first_class)
{
esho “The Student is eligible for the promotion with First Class”;
elseif ($Student_Mark>= $Pass_Mark)
{
echo “The Student is eligible for the promotion”;
}
else
{
echo “The Student is not eligible for the promotion”;
}?>
Question 5.
Explain the if-else statement in PHP?
Answer:
If else statement in PHP:
If a statement executes a statement or a group of statements if a specific condition is satisfied by the user expectation. When the condition gets false (fail) the else block is executed.
Syntax:
if (condition)
{
Execute statement(s) if condition is true;
}
else
{
Execute statement(s) if condition is false;
}
Example:
<?php
$Pass_Mark=35;
$Student_Mark=70;
if ($Student_Mark>= $Pass_Mark){
echo “The Student is eligible for the promotion”;
}
else {
echo “The Student is not eligible for the promotion”;
}?>
Samacheer Kalvi 12th Computer Applications Solutions PHP Conditional Statements Additional Question and Answer
I. Choose the Best Answer
Question 1.
What will be the output of the following PHP code ?
<?php
if(0.1)
print”hi”;
else
print”how are u”;
?>
a) how are u
b) hi
c) error
d) no output
Answer:
b) hi
Question 2.
When the condition in the If-else block fails then …………………………. block will be executed?
(a) if
(b) else
(c) Nested if
(d) while
Answer:
(b) else
Question 3.
What will be the output of the following PHP code ?
<?php
$x=1;
if($x==2)
print”hi”;
elseif($x=2)
print$x;
else
print”how are u”;
?>
a) error
b) 2
c) hi
d) how are u
Answer:
b) 2
Question 4.
The …………………………… block will be executed if it is not matched with any of the case values in the switch.
Answer:
default
Question 5.
The if statement contains ………………………….. expressions.
(a) arithmetic
(b) logical
(c) boolean
(d) Territory
Answer:
(c) boolean
Question 6.
If statements have to be given in …………………………
(a) ( )
(b) <>
(c) [ ]
(d) { }
Answer:
(a) ( )
Question 7.
The block of statements have to be enclosed with
(a) ( )
(b) <>
(c) [ ]
(d) { }
Answer:
(d) { }
Question 8.
What will be the output of the following PHP code ?
<?php
$a=100;
if($a>10)
printfC’M.S. Dhoni”);
elseif($a>20)
printffM.E.K Hussey”);
elseif($a>30)
printf(“A.B. de villiers”);
?>
a) M.S.Dhoni
b) M.E.K.Hussey
c) M.S.Dhoni M.E.K.Hussey A.B.de Villiers
d) No output
Answer:
a) M.S.Dhoni
II. Short Answer
Question 1.
Write a PHP code to display “Have a nice weekend!” if the current day is Friday, otherwise it will output “Have a nice day!” using if-else statement.
Answer:
<?php
$d=date(“D”);
if($d==”Fri”)
{
echo”Have a nice weekend!”;
}
Else
{
echo”Have a nice day!”;
>
?>
How to Prepare using Samacheer Kalvi 12th Computer Applications Chapter 6 PHP Conditional Statements Notes PDF?
Students must prepare for the upcoming exams from Samacheer Kalvi 12th Computer Applications Chapter 6 PHP Conditional Statements Notes PDF by following certain essential steps which are provided below.
- Use Samacheer Kalvi 12th Computer Applications Chapter 6 PHP Conditional Statements notes by paying attention to facts and ideas.
- Pay attention to the important topics
- Refer TN Board books as well as the books recommended.
- Correctly follow the notes to reduce the number of questions being answered in the exam incorrectly
- Highlight and explain the concepts in details.
Samacheer Kalvi 12th Computer Applications All Chapter Notes PDF Download
- Samacheer Kalvi 12th Computer Applications Chapter 1 Multimedia and Desktop Publishing Notes PDF Download: Tamil Nadu STD 12th Computer Applications Chapter 1 Multimedia and Desktop Publishing Notes
- Samacheer Kalvi 12th Computer Applications Chapter 2 An Introduction to Adobe Pagemaker Notes PDF Download: Tamil Nadu STD 12th Computer Applications Chapter 2 An Introduction to Adobe Pagemaker Notes
- Samacheer Kalvi 12th Computer Applications Chapter 3 Introduction to Database Management System Notes PDF Download: Tamil Nadu STD 12th Computer Applications Chapter 3 Introduction to Database Management System Notes
- Samacheer Kalvi 12th Computer Applications Chapter 4 Introduction to Hypertext Pre-Processor Notes PDF Download: Tamil Nadu STD 12th Computer Applications Chapter 4 Introduction to Hypertext Pre-Processor Notes
- Samacheer Kalvi 12th Computer Applications Chapter 5 PHP Function and Array Notes PDF Download: Tamil Nadu STD 12th Computer Applications Chapter 5 PHP Function and Array Notes
- Samacheer Kalvi 12th Computer Applications Chapter 6 PHP Conditional Statements Notes PDF Download: Tamil Nadu STD 12th Computer Applications Chapter 6 PHP Conditional Statements Notes
- Samacheer Kalvi 12th Computer Applications Chapter 7 Looping Structure Notes PDF Download: Tamil Nadu STD 12th Computer Applications Chapter 7 Looping Structure Notes
- Samacheer Kalvi 12th Computer Applications Chapter 8 Forms and Files Notes PDF Download: Tamil Nadu STD 12th Computer Applications Chapter 8 Forms and Files Notes
- Samacheer Kalvi 12th Computer Applications Chapter 9 Connecting PHP and MYSQL Notes PDF Download: Tamil Nadu STD 12th Computer Applications Chapter 9 Connecting PHP and MYSQL Notes
- Samacheer Kalvi 12th Computer Applications Chapter 10 Introduction to Computer Networks Notes PDF Download: Tamil Nadu STD 12th Computer Applications Chapter 10 Introduction to Computer Networks Notes
- Samacheer Kalvi 12th Computer Applications Chapter 11 Network Examples and Protocols Notes PDF Download: Tamil Nadu STD 12th Computer Applications Chapter 11 Network Examples and Protocols Notes
- Samacheer Kalvi 12th Computer Applications Chapter 12 DNS (Domain Name System) Notes PDF Download: Tamil Nadu STD 12th Computer Applications Chapter 12 DNS (Domain Name System) Notes
- Samacheer Kalvi 12th Computer Applications Chapter 13 Network Cabling Notes PDF Download: Tamil Nadu STD 12th Computer Applications Chapter 13 Network Cabling Notes
- Samacheer Kalvi 12th Computer Applications Chapter 14 Open Source Concepts Notes PDF Download: Tamil Nadu STD 12th Computer Applications Chapter 14 Open Source Concepts Notes
- Samacheer Kalvi 12th Computer Applications Chapter 15 E-Commerce Notes PDF Download: Tamil Nadu STD 12th Computer Applications Chapter 15 E-Commerce Notes
- Samacheer Kalvi 12th Computer Applications Chapter 16 Electronic Payment Systems Notes PDF Download: Tamil Nadu STD 12th Computer Applications Chapter 16 Electronic Payment Systems Notes
- Samacheer Kalvi 12th Computer Applications Chapter 17 E-Commerce Security Systems Notes PDF Download: Tamil Nadu STD 12th Computer Applications Chapter 17 E-Commerce Security Systems Notes
- Samacheer Kalvi 12th Computer Applications Chapter 18 Electronic Data Interchange – EDI Notes PDF Download: Tamil Nadu STD 12th Computer Applications Chapter 18 Electronic Data Interchange – EDI Notes
0 comments:
Post a Comment