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: 10/10/2019
Control Structures
Download Tamil Nadu 12th Standard Computer Science 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 Science Test

1.
List the differences between break and continue statements.
2.
Write the syntax of while loop.
3.
Using if..else..elif statement write a suitable programs to display largest of 3 numbers.
4.
Write note on if..else structure.
5.
Write a program to display
A
A B
A B C
A B C D
A B C D E
6.
Write a program in python to display the following output.
(i) 5 5 5 5 5
4 4 4 4
3 3 3
2 2
1
(ii) 1 2 3 4 5
1 2 3 4
1 2 3
1 2
1
7.
Write a program in python to display he following output.
1
2 2
3 3 3
4 4 4 4
5 5 5 5 5
8.
Write a program in python to display the following output.
1
1 2
1 2 3
1 2 3 4
1 2 3 4 5
9.
Explain Jump statement in python.
10.
Write a detail note on if..else..elif statement with suitable example.
1.
| Break | Continue |
| The break statement terminates the loop containing it. | The continue statement is used to skip the remaining part of a loop. |
| Control of the program flows to the statement immediately after the body ot the loop. | Control of the program flows start with next iteration |
| Syntax : break | Syntax : continue |
2.
Syntax :
while <condition>;
statements block 1
[else:
statements block2]
3.
Code :
n1 = int(input(:Enter the first number:"))
n2 = int(input("Enter the second number:")
n3 = int(input(:Enter the third number:")
if(n1?=n2) and(n1>=n3) :
biggest = n1 ;
elif(n2>=nl)and (n2>=n3) :
biggest = n2
else:
biggest = n3
print("The biggest number between",n1,",",n2"and"n3"is",biggest)
Output :
Enter the first number : 1
Enter the second number : 3
Enter the third number : 5
The biggest number between 1, 3 and 5 is 5
4.
(i) The if.. else statement provides control to check the true block as well as the false block,
(ii) Syntax :
if
statemets-block 1
else :
statement-block 2
(iii) if..else statement thus provides possibilities and the condition determines which BLOCK is to be executed.
5.
for i in range (1, 6) :
for j in range (65, 65 + i)
a = chr(j)
print a
print
6.
(i) for i in range (5, 0,-1):
for j in range (1, i + 1):
print (i, end =' ')
print (end = '\n')
i+ = 1
(ii) for i in range (5, 0, -1):
for j in range (1, i + 1):
print (j end =' ')
print (i, end = '\n')
i+ = 1
7.
for i in range (1,6):
for j in range (1, i+1)
print (i, end =' ')
print (end = '\n')
i+ = 1
8.
i=1
while (i < = 6):
for j in range (1,i):
print (j,end='\t')
print (end='\n')
i+=1
Output:
1
1 2
1 2 3
1 2 3 4
1 2 3 4 5
9.
The jump statement in Python, is used to unconditionally transfer the control from one part of the program to another. There are three keywords to achieve jump statements in Python: break, continue, pass. The following flowchart illustrates the use of break and continue.

(i) break statement: The break statement terminates the loop containing it. Control of the program flows to the statement immediately after the body of the loop. A while or for loop will iterate till the condition is tested false, but one can even transfer the control out of the loop (terminate) with help of break statement. When the break statement is executed, the control flow of the program comes out of the loop and starts executing the segment of code after the loop structure. If break statement is inside a nested loop (loop inside another loop), break will terminate the innermost loop.
Syntax:
break
(ii) Continue statement: Continue statement unlike the break statement is used to skip the remaining part of a loop and start with next iteration.
Syntax:
continue
(iii) Pass statement: pass statement is generally used as a placeholder. When we have a loop or function that is to be implemented in the future and not now, we cannot develop such functions or loops with empty body segment because the interpreter would raise an error. So, to avoid this we can use pass statement to construct a body that does nothing.
Syntax:
pass
10.
Nested if..elif..else statement :
(i) When we need to construct a chain of if statement(s) then 'elif' clause can be used instead of 'if else'.
(ii) Syntax:
if < condition - 1>:
statements-block 1
elif < condition - 2>:
statements-block 2
else:
statements-block n
(iii) In the syntax of if..elif ..else mentioned above, condition -1 is tested if it is true then statements-block 1 is executed, otherwise, the control checks condition-2, if it is true statements-block 2 is executed and even if it fails statements-block n mentioned in else part is executed.
(iv) 'elif' clause combines if..else-if ..else statements to one if..elif ... else. 'elif' can be considered to be abbreviation of 'else if'. In an 'if' statement there is no limit of 'elif' clause that can be used, but an 'else' clause if used should be placed at the end.
(v) Example: # Program to illustrate the use of nested if statement
| Average | Grade |
| > = 80 and above | A |
| > = 70 and < 80 | B |
| > = 60and < 70 | C |
| > = 50 and < 60 | D |
| Otherwise | E |
m1 = int (input("Enter mark in first subject:"))
m2 = int (input("Enter mark in second subject:"))
avg = (m1+m2)/2
if avg > =80:
print ("Grade : A")
elif avg > =70 and avg < 80:
print ("Grade : B")
elif avg > =60 and avg < 70:
print ("Grade : C")
elif avg > =50 and avg < 60:
print ("Gradec: D")
else:
print("Grade : E")
Output 1:
Enter mark in first subject : 34
Enter mark in second subject : 78
Grade : D
Output 2:
Enter mark in first Subject : 67
Enter mark in second subject : 73
Grade: B
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