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: 05/09/2022
QB365 provides a detailed and simple solution for every Possible Creative Questions in Class 12 Computer Science Subject - Function , English Medium. It will help Students to get more practice questions, Students can Practice these question papers in addition to score best marks.
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.
What are the various syntax for function types.
2.
Write the function that finds the minimum of its three arguments.
3.
Write a program to check the given number is even or odd.
4.
Explain about random ( ) function.
5.
Give one theoretical advantage of pure functions?
6.
What is pure function? Give an example.
7.
Write a short note an syntax for function types.
8.
Write an algorithm to check whether the entered number is even or odd.
9.
Explain the syntax of function definitions.
1.
The syntax for function types:
\({ }^{*} \mathrm{x} \rightarrow \mathrm{y} \quad{ }^{*} \mathrm{xl} \rightarrow \mathrm{x} 2 \rightarrow \mathrm{y} \quad{ }^{*} \mathrm{xl} \rightarrow \ldots \rightarrow \mathrm{xn} \rightarrow \mathrm{y}\)
The 'x' and 'y' are variables indicating types. The type x → y is the type of a function that gets an input of type 'x' and returns an output of type 'y'. Whereas x1 → x2 → y is a type of a function that takes two inputs, the first input is of type 'x1' and the second input of type 'x2', and returns an output of type 'y'.
Likewise x1 → ... → xn → y has type 'x' as input of n arguments and 'y' type as output.
2.
let minxyz:=
if x <y then x else z;
else
if y< 2 then y else z;
3.
Program:
(requires:x > = 0)
let rec even x: =
x= 0||odd (x-1)
return 'even'
(requires: x> = 0)
let odd x: =
x<>&&even (x-1)
return 'odd'
4.
The mathematical function random () will give different outputs for the same function call.
let Random number
let a:= random()
if a>10 then return: a
else return: 10
Here the function Random is impure as it is not sure what will be the result when we call the function.
5.
There are various theoretical advantages of having pure functions. one advantage is that if a function is pure, then if it is called several times with the same arguments, the compiler only needs to actually call the function once.
Let see an example
let i:=0;
if i<strlen(s) then
--Do something which doesn't affects
++i
If the compiler is smart to enough to work out that strlen is a pure function and that 's' is not updated in the loop, then it can remove the redundant extra calls to strlen and make the loop to execute only one time.
6.
Pure functions are functions which will give exact result when the same arguments are passed. A function can be a pure function provided it should not have any external variable which will alter the behaviour of that variable.
Example:
let square x
return: x*x
The above function square is a pure function because it will not give different results for same input.
7.
The syntax for function types
x\(\rightarrow \)y
x1 \(\rightarrow \)x2\(\rightarrow \)y
x1 \(\rightarrow \) .... \(\rightarrow \)x n\(\rightarrow \)y
The 'x' and 'y' are variables indicating types. The type x \(\rightarrow \) y is the type of a function that gets an input of type 'x' and returns an output of type 'y'. Where as x1\(\rightarrow \) x2 -\(\rightarrow \) y is a type of a function that takes two inputs, the first input is of type 'x1' and the second input of type 'x1', and returns an output of type 'y'. Likewise x1 \(\rightarrow \)...\(\rightarrow \)x n\(\rightarrow \)y has type 'x' as input of n arguments and 'y' type as output.
8.
(requires: x>= 0)
let rec even x :=
x=0II odd (x-I)
return 'even'
(requires: x > = 0)
let odd x :=
x< >0 && even (x-I)
return 'odd'
9.
(i) The syntax to define functions is close to the mathematical usage: the definition is introduced by the keyword let, followed by the name of the function and its arguments; then the formula that computes the image of the argument is written after an = sign. If you want to define a recursive function: use "let rec" instead of "let".
(ii) Syntax: The syntax for function definitions:
let rec fn a1 a2 ... an :;= k
(iii) Here the 'fn' is a variable indicating an identifier being used as a function name. The names 'a1' to 'an' are variables indicating the identifiers used as parameters. The keyword 'rec' is required if 'fn' is to be a recursive function; otherwise it may be omitted.
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