12th Standard Syllabus & Materials
12th Standard
TN 12th Computer Applications மின்னணு தரவு பரிமாற்றம் Sample Question Papers Study Material - QB365 Set A
NEW12th Standard
TN 12th Computer Applications மின் - வணிக பாதுகாப்பு அமைப்புகள் Sample Question Papers Study Material - QB365 Set A
NEW12th Standard
TN 12th Computer Applications மின்னணு செலுத்தல் முறைகள் Sample Question Papers Study Material - QB365 Set A
NEW12th Standard
TN 12th Computer Applications மின் - வணிகம் Sample Question Papers Study Material - QB365 Set A
NEW12th Standard
TN 12th Computer Applications திறந்த மூல கருத்துருக்கள் Sample Question Papers Study Material - QB365 Set A
NEW12th Standard
TN 12th Computer Applications வலையமைப்பு வடமிடல் Sample Question Papers Study Material - QB365 Set A

Published on: 04/09/2019
Looping Structure
Download Tamil Nadu 12th Standard Computer Applications question papers, model tests, one-mark questions, important questions, and public exam papers in PDF format. Free study materials and answer keys for TN State Board students.
Questions + Answers key
Take MCQ Computer Applications Test

1.
What will be the output of the following PHP code ?
< ?php
for (\($\)x = -1; \($\)x < 10;--\($\)x)
{
print \($\)x;
}
? >
123456713910412
123456713910
1234567139104
Infinite loop
2.
What will be the output of the following PHP code ?
< ?php
for (\($\)x = 1; \($\)x < 10;++\($\)x)
{
print “*\t”;
}
? >
**********
*********
***********
Infinite loop
3.
What will be displayed in a browser when the following PHP code is executed :
< ?php
for (\($\)counter = 10; \($\)counter < 10;
\($\)counter = \($\)counter + 5){
echo “Hello”;
}
? >
Hello Hello Hello Hello Hello
Hello Hello Hello
Hello
None of the above
4.
Loops that iterate for fixed number of times is called
Unbounded loops
Bounded loops
While loops
For loops
5.
Most complicated looping structure in PHP is ________
While
Do While
for
None of them
6.
Write Syntax of Do while loop in PHP.
7.
Write Syntax of For loop in PHP.
8.
Define Looping Structure in PHP
9.
Differentiate While and Do while loops.
10.
Differentiate For each and While loop.
11.
Write the features Looping Structure.
12.
Explain working of loops in array
13.
Explain the process Do while loop.
1.
(d)
Infinite loop
2.
(b)
*********
3.
(d)
None of the above
4.
(b)
Bounded loops
5.
(c)
for
6.
Syntax of Do while loop
do
{
code to be executed;
} while (condition is true);
7.
Syntax of 'for loop'
for (init counter; test counter; increment counter)
{
code to be executed;
}
8.
Loop structures in PHP is an iterative control structures that involves executive the same block of code a specified number of times. Loops that iterate for fixed no of times is also called as Bounded loops.
9.
| While loop | Do while loop |
| (i) It is important feature which is used for simple iteration logics. | (i) It always run the statement inside of the loop block at the first time execution. |
| (ii) It is Entry controlled loop | (ii) It is exit controlled loop |
| (iii) It checks the condition, and executes the loop if specified condition is true. | (iii) It checks the condition, and then repeats the loop as long as the specified condition is true. |
| Syntax : While(condition) { code to be executed; } |
Syntax : do { code to be executed; } while (condition is true); |
10.
| For each loop | While loop |
| (i) It provides an easy way to iterate over arrays. | (i) It is used for simple iteration logics. |
| (ii) Loop iteration depends on each KEY value pair in the Array | (ii) It executes block of code while the specified condition is true. |
| (iii) Syntax: for each (Sarray as $value) { code to be executed; } |
(iii) Syntax: while (condition is true) { code to be executed; } |
11.
(i) PHP Loop Often when you write code, you want the same block of code to run over and over again in a row.
(ii) Instead of adding several almost equal code-lines in a script, we can use loops to perform a task.
(iii) Looping structures are useful for writing iteration logics.
(iv) It is the most important feature of many programming languages, including PHP.
12.
1. The array concepts in looping structure is used in for each loop.
2. For each loop is exclusively available in PHP. It works only with arrays.
3. The loop iteration depends on each KEY value pair in the array. In for each, loop iteration the value of the current array element is assigned to $value variable and the array pointer is shifted by one until it reaches the end of the array element.
4. For each works only on arrays and objects, and will issue an error when you try to use it on a variable with a different data type or an uninitialized variable.
Syntax:
for each ($ array as $ value)
{
code to be executed;
}
1. The for each statement is used to loop through arrays.
2. 'For each' pass the value of the current array element is assigned to $value and the array pointer is moved by one and in the next pass next element will be processed.
Example:
$array = array (1, 2, 3);
{
echo "Value is $value
";
}
?>
Output:
Value is 1
Value is 2
Value is 3
13.
Do while loop always run the statement inside of the loop block at the first time of execution. Then it checks the condition whether true or false. It executes the loop, if the specified condition is true.
Syntax:
do
{
code to be executed;
} while (condition is true);
Example
\(\$\)Student_count = 10;
\(\$\)student_number= 1;
do
{
echo "The student number is: \(\$\)student_number
";
\(\$\)student_number++ ;
}
while(\(\$\)student_number< = \(\$\)Student_count);
?>

12th Standard Syllabus & Materials
12th Standard
TN 12th Computer Applications களப்பெயர் முறைமை (DNS) Sample Question Papers Study Material - QB365 Set A
NEW12th Standard
TN 12th Computer Applications வலையமைப்பு எடுத்துக்காட்டுகள் மற்றும் நெறிமுறைகள் Sample Question Papers Study Material - QB365 Set A
NEW12th Standard
TN 12th Computer Applications கணினி வலையமைப்பு ஓர் அறிமுகம் Sample Question Papers Study Material - QB365 Set A
NEW12th Standard
TN 12th Computer Applications PHP-உடன் MySQL-ஐ இணைத்தல் Sample Question Papers Study Material - QB365 Set A
Tamilnadu Stateboard 12th Standard Subjects

Maths

Chemistry

Physics

Biology

Computer Science

Business Maths and Statistics

Economics

Commerce

Accountancy

History

Computer Applications

Biology

Computer Technology

Computer Applications

Computer Science

Business Maths and Statistics

Commerce

Economics

Maths

Chemistry

Physics

Computer Technology

History

Accountancy

Tamil

English

French
Tamilnadu Stateboard Standards