Read and download free pdf of Class 12 Objective Oriented Programming in C++ Revision Notes. Students and teachers of Class 12 Computer Science can get free advanced study material, revision notes, sure shot questions and answers for Class 12 Computer Science prepared as per the latest syllabus and examination guidelines in your school. Standard 12 students should download this study material which will give them more knowledge for all chapters in Computer Science and all important topics which are scoring and can get you more marks. Students should also download free pdf of Chapter wise Notes for Class 12 Computer Science prepared by school teachers as per the latest NCERT, CBSE, KVS books and syllabus issued this year and also download free worksheets and question papers available here to get higher scores in school exams and tests, also click here for more Study Material for Class 12 Computer Science
♦ Keywords: Keywords are the certain reserved words that convey a special meaning to the compiler. These are reserve for special purpose and must not be used as identifier name.eg for , if, else , this , do, etc.
♦ Identifiers: Identifiers are programmer defined names given to the various program elements such as variables, functions, arrays, objects, classes, etc.. It may contain digits, letters and
underscore, and must begin with a letter or underscore. C++ is case sensitive as it treats upper and lower case letters differently. A keyword can not be used as an identifiers. The following are some valid identifiers:
Pen time580 s2e2r3 _dos _HJI3_JK
♦ Data Types in C++: Data types are means to identify the types of data and associated operations of handling it. Data types in C++ are of two types:
1. Fundamental or Built-in data types: These data types are already known to compiler. These are the data types those are not composed of other data types.
There are following fundamental data types in C++:
(i) int data type (for integer)
(ii) char data type (for characters)
(iii) float data type (for floating point numbers)
(iv) double data type
♦ Data Type Modifiers: There are following four data type modifiers in C++ , which may be used to modify the fundamental data types to fit various situations more precisely:
(i) signed
(ii) unsigned
(iii) long
(iv) short
♦ Variables: A named memory location, whose contains can be changed with in program execution is known as variable.
OR
A variable is an identifier that denotes a storage location, which contains can be varied during program execution.
Declaration of Variables: Syntax for variable declaration is:
datatypes variable_name1, variable_name2, variable_name3,……………. ;
We can also initialize a variable at the time of declaration by using following syntax:
datatypes variable_name = value;
In C++ both the declaration and initialization of a variable can be done simultaniouly at the
place where the variable is used first time this feature is known as dynamic initialization. e.g.,
float avg;
avg = sum/count;
then above two statements can be combined in to one as follows:
float avg = sum/count;
♦ Constant: A named memory location, whose contains cannot be changed with in program execution is known as constant.
OR
A constant is an identifier that denotes a storage location, which contains cannot be varied during program execution.
Syntax for constant declaration is:
const datatypes constant_name = value ;
e.g., const float pi = 3,14f ;
♦ Conditional operator ( ? : ):
The conditional operator (? :) is a ternary operator i.e., it require three operands. The general form of
conditional operator is:
expression1? expression2: expression3 ;
Where expression1 is a logical expression , which is either true or false.
If expression1 evaluates to true i.e., 1, then the value of whole expression is the value of expression2,
otherwise, the value of the whole expression is the value of expression3. For example
min = a<b? a : b ;