11th Standard Syllabus & Materials
11th Standard
TN 11th Tamil இயற்கை வேளாண்மை,சுற்றுச்சூழல் -செய்யுள் - மனோன்மணீயம் Important Questions And Answers Study Material - QB365 Set A
NEW11th Standard
TN 11th Tamil என்னுயிர் என்பேன் -துணைப்பாடம் - இசைத்தமிழர் இருவர் Important Questions And Answers Study Material - QB365 Set A
NEW11th Standard
TN 11th Tamil மொழி கலை -செய்யுள் - ஒவ்வொரு புல்லையும் Important Questions And Answers Study Material - QB365 Set A
NEW11th Standard
TN 11th Tamil பீடு பெற நில் - இலக்கணம் - பகுபத உறுப்புகள் Important Questions And Answers Study Material - QB365 Set A
NEW11th Standard
TN 11th Tamil பீடு பெற நில் - துணைப்பாடம் - வாடிவாசல் Important Questions And Answers Study Material - QB365 Set A
NEW11th Standard
TN 11th Tamil பீடு பெற நில் - செய்யுள் - குறுந்தொகை Important Questions And Answers Study Material - QB365 Set A

Published on: 01/10/2019
Functions
Download Tamil Nadu 11th 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.
Name any four functions belongs to stdio.h?
2.
Write a note on Local Scope.
3.
What are importance of void data type.
4.
Write about strlen() function.
5.
Define Functions.
6.
Write a C++ program to find area a circle.
7.
Write a note on isalpha() function.
8.
Define user defined functions
9.
What is default arguments? Give example.
10.
What are the information the prototype provides to the compiler?
11.
Write about strcmp() function.
12.
What is Built-in functions?
13.
Write a program to accept any integer number and reverse it.
14.
What are the different forms of function return? Explain with example.
15.
16.
How many ways the programmers can make use of functions in C++?
4
5
3
2
17.
A program can be split into small sub-program are called _______.
expressions
functions
control flow
composition
18.
Which of the following is the scope operator?
>
&
%
::
19.
Which is return data type of the function prototype of add(int, int);?
int
float
char
double
20.
Which of the following header file defines the standard I/O predefined functions?
stdio.h
math.h
string.h
ctype.h
1.
getchar(), putchar(), gets(), puts()
2.
(i) A local variable is defined within a block. A block of code begins and ends with curly braces { }.
(ii) The scope of a local variable is the block in which it is defined.
(iii) A local variable cannot be accessed from outside the block of its declaration.
(iv) A local variable is created upon entry into its block and destroyed upon exit
3.
Void type has two important purposes:
(I) To indicate the function does not return a value
(ii) To declare a generic pointer
4.
The strelen() takes a null terminated byte string source as its argument and returns its length. The length does not include the null(\0) character.
5.
A large program can typically be split into small subprograms (blocks) called as functions where each sub-program can perform some specific functionality. Functions reduce the size and complexity of a progrann, makes it easier to understand, test, and check for errors.
6.
#include < iostream >
using namespace std;
double area(const double r,const double pi=3.14)
{
return(pi*r*r);
}
int main 0
{
double rad,res;
cout << "\nEnter Radius :";
cin >> rad; .
res=area(rad);
cout << "\nThe Area of Circle =" << res;
return 0;
}
Output:
Enter Radius :5
The Area of Circle =78.5
7.
The isalpha() function is used to check whether the given character is an alphabet or not.
Syntax:
int isalpha(char c);
This function will return 1 if the given character is an alphabets, and 0 otherwise 0. The following statement assigns 0 to the variable n, since the given character is not an alphabet.
int n=isalphaf ('3');
But, the statement given below display 1, since the given character is an alphabet.
cout << isalpha ('a')
8.
C++ also provides the facility to create new functions for specific task as per user requirement. The name of the task and data required (arguments) are decided by the user and hence they are known as User-defined functions.
9.
In C++, one can assign default values to the formal parameters of a function prototype. The Default arguments allows to omit some arguments when calling the function.
When calling a function,
For any missing arguments, complier uses the values in default arguments for the called function.
i. The default value is given in the form of variable initialization.
Example: void defaultvalue(int n1-10. n2=100);
ii. The default arguments facilitate the function call statement with partial or no arguments.
Example: defaultvalue(x,y);
defaultvalue(200,150);
defaultvalue(150);
defaultvalue(x,150);
iii. The default values can be included in the function prototype from right to left, ie, we cannot have a default value for an argument in between the argument list.
Example: void defaultvalue(int n1-10, n2);//invalid prototype
void defaultvalue(int n1, n2 = 10);//valid prototype
10.
(i) The return value of the function is of type long.
(ii) fact is the name of the function.
(iii) The function is called with two arguments:
The first argument is of int data type.
The second argument is of double data type.
int display(int, int) // function prototype
The above function prototype provides details about the return data type, name of the function and a list of formal parameters or arguments.
11.
The strcmp () function takes two arguments: string 1 and string 2. It compares the contents of string 1 and string 2 lexicographically.
The strcmp() function returns a:
(i) Positive value if the first differing character in string 1 is greater than the corresponding character in string 2. (ASCII values are compared).
(ii) Negative value if the first differing character in string 1 is less than the corresponding character in string 2.
(iii) 0 if string 1 and string 2 are equal.
12.
C++ provides a rich collection of functions ready to be used for various tasks. The tasks to be perfornned by each of these are already written, debugged and compiled, their definitions alone are grouped and stored in files called header files. Such ready-touse sub programs are called pre-defined functions or build-in functions.
13.
#include<iostream>
using namespace std;
int reverse (int n);
int main()
{
int n=0, result = 0;
cout<<"Enter number:"";
cin >>n;
result reverse (n);
cout<<"Reverse number is:" << result << endl;
}
int reverse (int n)
{
int temp=0, rev = 0;
while (n! =0).
{
temp=n;
rev= (rev*10) + temp;
n = n/10;
}
return rev;
}
Output:
Enter number: 1 2 3
Reverse number: 3 2 1
14.
The return statement
Returning from the function is done by using the return statement. The return statement stops execution and returns to the calling function. When a return statement is executed, the function is terminated immediately at that point. The return statement is used to return from a function. It is categorized as a jump statement because it terminates the execution of the function and transfer the control to the called statement.
Syntax:
return expression/variable;
Example: return(a+b); return(a);
return; // to terminate the function
The Returning values:
The functions that return no value is declared a void. The data type of a function is treated as int, if no data type is explicitly mentioned. For example,
For Example:
int add (int, int);
add (int, int);
In both prototypes, the return value is int, because by default the return value of a function in C++ is of type int.
Returning Non-integer values
A string can also be returned to a calling statement.
#include <iostream>
#include<string.h>
using namespace std;
char*display()
{
return ("chennai");
}
int main()
{
char s[50];
strcpy(s,display());
cout<<"\n Example:Function with Non Integer Return"<<s;
return(0);}
Output:
Example: Function with Non Integer Return Chennai
The Returning by reference
#include<iostream>
using namespace std;
int main()
{
int nl-150;
int &nlrefn1;
cout<<"\nThe Value of NI =" <<n<< "and nl Reference="<<n/ref;
n1ref++;
cout<<"\n After nl increased the Value of N1 ="<<nl;
cout<<"and nl Reference="<<ntref;
return(0);
Output:
The Value of N1 - 150 and n1 Reference - 150
After n1 increased the Value of N1 =151 and n1 Reference = 151
15.
16.
(d)
2
17.
(b)
functions
18.
(d)
::
19.
(a)
int
20.
(a)
stdio.h
11th Standard Syllabus & Materials
11th Standard
TN 11th Tamil பீடு பெற நில் - செய்யுள் - காவடிச்சிந்து Important Questions And Answers Study Material - QB365 Set A
NEW11th Standard
TN 11th Tamil பீடு பெற நில் - உரைநடை - மலை இடப்பெயர்கள் : ஓர் ஆய்வு Important Questions And Answers Study Material - QB365 Set A
NEW11th Standard
TN 11th Tamil மாமழை போற்றுதும் - துணைப்பாடம் - யானை டாக்டர் Important Questions And Answers Study Material - QB365 Set A
NEW11th Standard
TN 11th Tamil மாமழை போற்றுதும் - செய்யுள் - ஐங்குறுநூறு Important Questions And Answers Study Material - QB365 Set A
Tamilnadu Stateboard 11th Standard Subjects

Maths

Commerce

Economics

Biology

Business Maths and Statistics

Accountancy

Computer Science

Physics

Chemistry

Maths

Biology

Economics

Physics

Chemistry

History

Business Maths and Statistics

Computer Science

Accountancy

Computer Applications

History

Computer Technology

Commerce

Computer Applications

Computer Technology

Tamil

English

French
Tamilnadu Stateboard Standards