Find the CBSE Class 12 Computer Science Introduction To C++ Notes below. Download comprehensive Class 12 Computer Science revision notes crafted by expert teachers to suit the 2026-27 academic schedule. These notes make tough concepts simple and list critical definitions, giving Class 12 students an edge in their final revision.
Concept Summary for Class 12 Computer Science Introduction To C++
Every Class 12 Computer Science student can review these Introduction To C++ notes to grasp main concepts quickly. The exam-friendly summaries highlight hard sections and high-scoring areas to make school assessments and final tests much easier.
Class 12 Computer Science Introduction To C++ Concept Notes
Structure-Collection of logically related different data types (Primitive and Derived) referenced under one name.
Nested structure
• A Structure definition within another structure.
• A structure containing object of another structure.
typedef
• Used to define new data type name
#define Directives
• Use to define a constant number or macro or to replace an instruction.
Inline Function
• Inline functions are functions where the call is made to inline functions, the actual code then gets placed in the calling program.
• What happens when an inline function is written?
• The inline function takes the format as a normal function but when it is compiled it is compiled as inline code. The function is placed separately as inline function, thus adding readability to the source program. When the program is compiled, the code present in function body is replaced in the place of function call.
General Format of inline Function:
The general format of inline function is as follows:
inline datatype function_name(arguments)
inline int MyClass( )
Example:
#include <iostream.h>
int MyClass(int);
void main( )
{int x;
cout << “\n Enter the Input Value: ”;
cin>>x;
cout<<”\n The Output is: “ << MyClass(
} inline int MyClass(int x1)
{return 5*x1;}
The output of the above program is:
Enter the Input Value: 10
The Output is: 50
The output would be the same even when the inline function is written solely as a function. The concept, however, is different. When the program is compiled, the code present in the inline function MyClass ( ) is replaced in the place of function call in the calling program. The concept of inline function is used in this example because the function is a small line of code.
The above example, when compiled, would have the structure as follows:
#include <iostream.h>
int MyClass(int);
void main( )
{int x;
cout << “\n Enter the Input Value: ”; cin>>x;
//The MyClass(x) gets replaced with code return 5*x1;
cout<<”\n The Output is: “ << MyClass(x);
}
#include <iostream.h>
int MyClass(int);
void main( )
{int x;
cout << “\n Enter the Input Value: ”;
cin>>x;
//Call is made to the function MyClass
cout<<”\n The Output is: “ << MyClass(x);
}
int MyClass(int x1)
{return 5*x1;}
1 Marks questions
1) Name the header files that shall be needed for the following code:
void main( )
{ char word[]=”Board Exam”;
cout<<setw(20)<<word;
}
2) Name the Header file to which the following built in functions belongs to:
(i) gets() (ii) abs() (iii) sqrt() (iv) open()
2 Marks questions:
1) Rewrite the following program after removing the syntactical error(s) if any. Underline each correction.
#include<iostream.h>
void main( )
{ F = 10, S = 20;
test(F;S);
test(S);
}
void test(int x, int y = 20)
{ x=x+y;
count<<x>>y;
}
2) Find the output of the following program:
#include<iostream.h>
void main( )
{ int U=10,V=20;
for(int I=1;I<=2;I++)
{ cout<<”[1]”<<U++<<”&”<<V 5 <<endl;
cout<<”[2]”<<++V<<”&”<<U + 2 <<endl; } }
3) Rewrite the following C++ program after removing the syntax error(s) if any. Underline each correction. [CBSE 2010]
include<iostream.h>
class FLIGHT
{ Long FlightCode;
Char Description[25];
public
void addInfo()
{ cin>>FlightCode; gets(Description);}
void showInfo()
{ cout<<FlightCode<<”:”<<Description<<endl;}
};
void main( )
{ FLIGHT F;
addInfo.F();
showInfo.F;
}
4) In the following program, find the correct possible output(s)from the options:
#include<stdlib.h>
#include<iostream.h>
void main( )
{ randomize( );
char City[ ][10]={“DEL”, “CHN”, “KOL”, “BOM”, “BNG”};
int Fly;
for(int I=0; I<3;I++)
{Fly=random(2) + 1;
cout<<City[Fly]<< “:”;
}}
Outputs:
(i) DEL : CHN : KOL: (ii) CHN: KOL : CHN:
(iii) KOL : BOM : BNG: (iv) KOL : CHN : KOL:
5) In the following C++ program what is the expected value of Myscore from options (i) to (iv) given below. Justify your answer.
#include<stdlib.h>
#include<iostream.h>
void main( )
{ randomize( );
int Score[ ] = {25,20,34,56,72,63},Myscore;
cout<<Myscore<<endl;
}I
i) 25 (ii) 34 (iii) 20 (iv) Garbage Value.
Answer to Questions
1 Marks Answer
1) Ans: iostream.h
iomanip.h
2) Ans: iostream.h (ii) math.h,stdlib.h (iii) math.h (iv)fstream.h
2 marks Answers
1 Ans:
#include<iostream.h>
void test(int x,int y=20); //Prototype missing
void main( )
{ int F = 10, S = 20; //Data type missing
Text(F,S); //Comma to come instead of ;
Text(S);
void Text(int x, int y)
{ x=x+y;
cout<<x<<y; //Output operator << required }
2 Ans:Output:
[1]10&15
[2]21&13
[1]11&16
[2]22&14
3 Ans: #include<iostream.h>
class FLIGHT
{ long FlightCode;
char Description[25];
public:
void addInfo()
{ cin>>FlightCode; gets(Description);}
void showInfo()
{ cout<<FlightCode<<”:”<<Description<<endl;}
};
void main( )
{ FLIGHT F;
F.addInfo();
F.showInfo;
}
4 Ans)
Since random(2) gives either 0 or 1, Fly value will be either 1 or 2.
Please click the link below to download pdf file for CBSE Class 12 Computer Science - Introduction to C++.
Free study material for Computer Science
Revision Notes & Key Concepts for Class 12 Computer Science Introduction To C++
Download Chapter Notes: Class 12 Computer Science Introduction To C++
Explore these Revision Notes for Introduction To C++ to check your comprehension levels instantly. Created per the latest CBSE standards for Class 12, these notes highlight recurring exam themes. Consistent review helps students secure higher marks across all school evaluations.
NCERT Based Introduction To C++ Summary
Compiled directly from the official NCERT book for Class 12 Computer Science, these notes offer reliable academic support. Following your chapter summary review, our educators recommend checking our detailed NCERT solutions for Class 12 to compare your understanding, helping build a strong foundation in Computer Science.
Enhance Retention with Free Study Materials
To prepare very well for your 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 Introduction To C++. All study material on our platform 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.
FAQs
You can download the teacher prepared revision notes for CBSE Class 12 Computer Science Introduction To C++ Notes from StudiesToday.com. These notes are designed as per 2026-27 academic session to help Class 12 students get the best study material for Computer Science.
Yes, our CBSE Class 12 Computer Science Introduction To 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.
Yes, our CBSE Class 12 Computer Science Introduction To C++ Notes provide a detailed, topic wise breakdown of the chapter. Fundamental definitions, complex numerical formulas and all topics of CBSE syllabus in Class 12 is covered.
These notes for Computer Science are organized into bullet points and easy-to-read charts. By using CBSE Class 12 Computer Science Introduction To C++ Notes, Class 12 students fast revise formulas, key definitions before the exams.
No, all study resources on StudiesToday, including CBSE Class 12 Computer Science Introduction To C++ Notes, are available for immediate free download. Class 12 Computer Science study material is available in PDF and can be downloaded on mobile.