Revision Notes for Class 12 Computer Science: Introduction To C++
Explore reliable concept summaries and revision materials through the CBSE Class 12 Computer Science Introduction To C++ Notes. Tailored for Class 12 learners, utilizing these notes for Computer Science Introduction To C++ ensures thorough preparation and strengthens core academic definitions before final evaluations.
Review Introduction To C++ for Class 12 Computer Science
Navigate directly to the revision notes for Introduction To C++ using the digital viewer below. Each summary is structured to highlight high-weightage sections, allowing students to instantly access critical definitions and focus on core exam topics.
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 and Key Concepts for Class 12 Computer Science Introduction To C++
Quick Revision Notes: Introduction To C++ (CBSE)
Access structured revision notes for Introduction To C++ designed in alignment with the latest CBSE curriculum for Class 12 Computer Science. These summaries help clarify core themes and support effective daily study.
Expert Study Material for Class 12 Computer Science
Each chapter summary is structured around standard CBSE textbooks, allowing students to check their understanding and clarify complex ideas early in their revision.
Complete Your Chapter Revision
Wrap up your chapter revision by testing your knowledge against standard question formats. Everything on our platform is provided free of charge.
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.