CBSE Class 11 Computer Science Functions In C++ Notes

Download the latest CBSE Class 11 Computer Science Functions In C++ Notes in PDF format. These Class 11 Computer Science revision notes are carefully designed by expert teachers to align with the 2025-26 syllabus. These notes are great daily learning and last minute exam preparation and they simplify complex topics and highlight important definitions for Class 11 students.

Chapter-wise Revision Notes for Class 11 Computer Science Functions In C++

To secure a higher rank, students should use these Class 11 Computer Science Functions In C++ notes for quick learning of important concepts. These exam-oriented summaries focus on difficult topics and high-weightage sections helpful in school tests and final examinations.

Functions In C++ Revision Notes for Class 11 Computer Science

Functions in C++

Objectives :


• to analyze how modularity is implemented in a program at its lowest level.


  To appreciate the use and importance of function in C++


  to program different types of functions and implement them practically.


  To understand difference between User Define Function and Library function.


3.1: Why to use functions ?

Who likes unnecessary repetition of task ? No body in this world. Every body thinks of re usability these days in every aspect of life. What will you do if your cycle wheel rim breaks down on fine day? Do you will throw the whole cycle or sell the cycle as scrap? No exactly not because cycles are designed in such a way that each of its parts can be repaired or replaced. So you will get a new cycle rim from market and will get it fitted in your cycle! This design of cycle where each of its parts have its own unique functionality and could be reassembled together to form a complete cycle is known as


Modular approach of designing. Each of the cycles part can thought as a Module which serves some purpose in the whole cycle but is very essential for proper functioning of the cycle. The whole concept is nothing but based on “Divide and Rule philosophy”. A bigger system is divided into smaller components so that each of these smaller parts could handled easily and effectively. These smaller parts when integrated gives rise to the bigger system. 

Just think GOD has also created human beings as a modular entity ! We humans have a body which is integration of organ system and each of these organ system is again integration of some organs. So here organs are acting as modules. These modules (organs) could be taken care of individually when we often fall ill.

Can you rightly describe what is opposite word for modularity ? Any system which is not modular is known as monolithic (अखंड) or indivisible. A monolithic system does not have any parts or modules, from top to bottom it is one piece.

Software industry has also adopted the modular approach of design where a big software is divided into several modules. Each of the modules are designed for performing specialized task in the whole software. These modules interact with other modules of the system to carry out essential functionality of the whole system.

Each module during its course of execution repeats same type of task, so whenever the whole system requires a specific type of task , for which a particular module is responsible , it calls or invokes that module and the task is done. This calling of module to perform a certain action , can be done several number of times while the software as a whole executes.

Let us understand the above concept with the help of a real life example. Suppose our KVS is going to develop a centralized software for managing all Kvs across the country. While designing such a software KVS has to divide the whole operation of the software into three big modules called as : Admin , Academic and Accounts, each of these modules could be again broken down into many simple and small sub-modules like Admin Module can have Admission , Construction , Recruitment, etc. whereas the Academics can again have sub-modules like Student Registration, Examination , Results etc. 

class_11_Computer_science_concept_1

When the whole software is divided into modules as seen in the above case scenario then the following benefits could be harvested :

i) Each module can be tracked individually and separately without taking much care of other modules.

ii) A module is a reusable piece of program which could used again and again. Suppose that Navodaya Vidyalaya now wants to make a software like KVS then they can re-use the same modules of KVS with some changes (customization).

iii) If error is found in one module the functionality of that particular module and its associated modules would be disturbed, the whole software will not suffer. Thus errors can be tracked easily and debugged in much less time, because programmer will know which module is causing error, so he will debug that particular module only not the whole software (much like when you visit doctor suffering from common cold , the doctor does not checks your brain!)

iv) System up gradation (the process of changing from older system to newer one) becomes much easier because only those modules which needs up gradation will be dealt leaving other things as it is. So we see that modularization of a system gives us much independence and flexibility in terms of fast program development , easier debugging , and re-usability.

 

How Functions in C++ are related to program modules :

 

Just as a software is divided into modules , each modules into sub-modules , a sub-module is further divided into several functions. So we may call a function as a micro-level module of a bigger software.

 

A function in C++ :

 

- is smaller section of code of bigger module/program.

 

- is re-usable piece of code.

 

- is very specific in nature as it performs a specific task.

 

- is often called many times in a program.

 

Thus a C++ function have all the advantages which a module has in a software.

 

3.2: Types of function :

 

Functions in C++ are of two basic types :

 

a) User Defined : written by a programmer as per his/her requirement domain.

 

b) Library Function : already available with C++ compiler and stored as Library, from

 

where they can be called and used in any C++ program.

 

3.2.1 : User Defined Functions :

 

A user define function in C++ is always created by programmer according to his/her program requirements. Suppose, if some programmer is making software for school management then his list of user defined functions may have functions such as : getFee( ) , calcResult( ) , setExam( ) , all these functions will be used only in school management software not any where else, as they are specially tailored function for school management software.

 

Let us see the syntax to declare a user defined function :

 

Function Declaration :

 

<return type> function_name( <parameter list> ) ;

 

where :

 

return type := is the value which the function returns , if function does not returns any

 

value then we may write there void.

 

function_name := any valid C++ identifier name

 

parameter list := declaration of variables of different data types separated by comma these values are inputs passed from outside to the function.

 

The function declaration as per the syntax given above is also called as prototype declaration. In C++ it is compulsory to declare prototype of a function before defining and using it .

 

The parameter variable in the declaration are also called Formal parameters.

 

Function Definition :
 
While function definition described about the structure of a function , its inputs and output type , the definition of function actually implements the code of the function. While defining a function we add C++ code to its block as per requirement.
Syntax : <return type> function_name( <parameter list> )
{ … }
Example : Declare and define a function which finds the sum of two integers and returns it.
int getSum( int , int ); // declaration of a function
int getSum( int a , int b ) // definition of the function
{
int r = a+b;
return r;
}
 
The above function declaration has a return type as integer , because the function is meant to return a sum of two numbers. Two numbers to be added are passed to the function as input parameter. The parameter list is having two int separated by a comma ( , ) it is not compulsory to write a variable names of the parameters in declaration. A semicolon is terminating the declaration of function.
The definition of function is having code written within its scope where the sum is calculated over the passed parameters a and b and the result is returned using a keyword return. It is compulsory that the return data type must be same as that of the datatype of the variable returned using return statement.
 
Workout yourself :
 
Declare the prototype of a function which :
i) multiplies three integers and return the product
ii) checks whether a passed integer parameter is even or odd
iii) prints your name 20 times.
 
Consider the few more definition of functions related to various program :
Function 3.1 :
// function to check whether a given number is prime or not
int isPrime(int );
int isPrime(int num )
{
int count = 0;
for( int i = 1 ; i <= num ; i++)
if( num % I == 0)
count++;

 

if (count > 2 )

 

return 0 ; // more than two factors means it is not prime , hence a false value is returned

 

else

 

return 1 ; // exactly two factors i.e. 1 and num itself means num is prime , hence return a

 

// true value i.e. 1

 

}

 

In the above function if the passed parameter to the function i.e. num would be a prime it will have exactly two factors counted out in variable count and if not would have more than 2 factors. After we conduct a looping over the num to check its divisibility by every value from 1 to num we get count incremented whenever num is divisible by i (looping-variable ). So on the termination of loop the variable count stores the total number of times num gets divisible in the loop.
We check this count value to find whether it is more than two or not, if it is more than two it means num has more than two factors and hence it does not satisfies to be a prime , hence we return an

 

integer 0 to designate that it is not prime , other wise we return 1.
Instead of returning 1 and 0 from function you directly print using cout that num is prime or not, but then don't forget to change the return type of the function isPrime( ) to void.


Please click the link below to download pdf file for CBSE Class XI Computer Science Functions in C++ Concepts.

CBSE Class 11 Computer Science Functions In C++ Notes

Students can use these Revision Notes for Functions In C++ to quickly understand all the main concepts. This study material has been prepared as per the latest CBSE syllabus for Class 11. Our teachers always suggest that Class 11 students read these notes regularly as they are focused on the most important topics that usually appear in school tests and final exams.

NCERT Based Functions In C++ Summary

Our expert team has used the official NCERT book for Class 11 Computer Science to design these notes. These are the notes that definitely you for your current academic year. After reading the chapter summary, you should also refer to our NCERT solutions for Class 11. Always compare your understanding with our teacher prepared answers as they will help you build a very strong base in Computer Science.

Functions In C++ Complete Revision and Practice

To prepare very well for y our exams, students should also solve the MCQ questions and practice worksheets provided on this page. These extra solved questions will help you to check if you have understood all the concepts of Functions In C++. All study material on studiestoday.com is free and updated according to the latest Computer Science exam patterns. Using these revision notes daily will help you feel more confident and get better marks in your exams.

Where can I download the latest PDF for CBSE Class 11 Computer Science Functions In C++ Notes?

You can download the teacher prepared revision notes for CBSE Class 11 Computer Science Functions In C++ Notes from StudiesToday.com. These notes are designed as per 2025-26 academic session to help Class 11 students get the best study material for Computer Science.

Are these Computer Science notes for Class 11 based on the 2026 board exam pattern?

Yes, our CBSE Class 11 Computer Science Functions In C++ Notes include 50% competency-based questions with focus on core logic, keyword definitions, and the practical application of Computer Science principles which is important for getting more marks in 2026 CBSE exams.

Do these Class 11 notes cover all topic-wise concepts for Computer Science?

Yes, our CBSE Class 11 Computer Science Functions In C++ Notes provide a detailed, topic wise breakdown of the chapter. Fundamental definitions, complex numerical formulas and all topics of CBSE syllabus in Class 11 is covered.

How can I use CBSE Class 11 Computer Science Functions In C++ Notes for quick last-minute revision?

These notes for Computer Science are organized into bullet points and easy-to-read charts. By using CBSE Class 11 Computer Science Functions In C++ Notes, Class 11 students fast revise formulas, key definitions before the exams.

Is there any registration required to download Class 11 Computer Science notes?

No, all study resources on StudiesToday, including CBSE Class 11 Computer Science Functions In C++ Notes, are available for immediate free download. Class 11 Computer Science study material is available in PDF and can be downloaded on mobile.