Page 1 :
+1 Computer Application/Science, , Data Types and Operators, Short Note, , To watch Video Class Click Here
Page 3 :
Fundamental data types, Fundamental data types are defined in C++ compiler. They are, also known as built-in data types., The following are the fundamental data types, int, float, double, char, void, , For representing integer number, For representing floating point numbers, For representing more precision floating point numbers, For representing a single character, For representing empty set of values
Page 5 :
User-defined data types, Data type defined by the programmer is user defined data type., Example: struct,class,union, , Derived data types, Data type derived from fundamental data types is derived data types., Example: Arrays, pointers, functions
Page 6 :
Variables, Named memory location is called variables. There are three important, aspects for a variable., –, –, –, , Variable Name, Memory address(L-Value), Content(R-Value), , int i =10, , R-Value, L-Value
Page 7 :
Operators, Is a symbol to represent an operation., Example : In a+b , + is an operator, Based on number of operands operators are classified into, Unary:Which takes only one operand Example: Unary + ,- (+45,-12), Binary:Which takes two operands Example: Arithmetic, operators(+,-,*,/,%), Relational oprators(<,>,<=,>=,==,!=)..., Ternary:Which takes three operands. Example: Conditional operator(?:)
Page 8 :
Based on the nature of operation operators, are classified into, Arithmetic operators +,-,*,/,%, ●, Relational operators <,>,<=,>=,==,!=, ●, Logical operators, !,&&,||, ●, Increment/Decrement ++,-●, Assignment operator =, ●, Arithmetic Assignment +=,-=,*=,/=,%=, ●, Input/Output operators >>,<<, ●, Conditional operator (Ternary operator) ?:, ●
Page 9 :
Arithmetic Operators
Page 10 :
Relational Operators, Used for comparing numeric values. Result is True/False
Page 11 :
Logical Operators, Result is True/False
Page 12 :
Input Output Operators, >> is the input operator. Also called get from or extraction, operator., << is the output operator . Also called put to or insertion operator
Page 13 :
Assignment Operators, = is the assignment operator. Used to store a value in a, variable.
Page 14 :
Expressions, Expressions are constituted by operators and operands, Arithmetic : Which uses arithmetic operators, Example :a+b,a-b, Relational :Which uses relational operators, Example:a<b, x==y,, Logical :Which uses logical operators, Example:a&&b , x>=y && x==20, !(a>b)
Page 15 :
Statements in C++, Smallest executable unit of a programming language., In C++ every statement is terminated by ;, There are four types of statements in C++, ●, , Declaration statements : Used for declaring variables, int n1;, , ●, , Input Statement : Used for reading a value from keyboard, cin>>n1;, , ●, , Assignment Statement: Used for storing a value to a variable, s=n1+n2;, , ●, , Output Statements:Used for displaying a value to the screen., cout<<s;
Page 16 :
Declaring a Variable, Before using a variable in a program, it must be declared., The general format for variable declaration is, DataType, Example :, int n;, float n1,n2;, char ch;, , VariableName1,Variable Name2....;
Page 18 :
Which among the following is an insertion, operator, a) >> b) << c) >, d) <, Ans) <<, , <<- Insertion /Output /Put to operation, , >>- Extraction/Input /Get from operation
Page 19 :
Differentiate = and ==, Ans) = is assignment operator, == is relational operator
Page 20 :
What are the outputs of below operations, i) 15%4 ii) 5/2, iii) 5<6 iv) !(4>2), Ans) i) 3, ii) 2, Iii) True(Any non zero number), iv) False/0, , % gives reminder after division(modulus), Output of relational /Logical operators are True/, False
Page 21 :
To watch Video Class Click Here