4.CPP Notes Part 4 Some Imp Terms
4.CPP Notes Part 4 Some Imp Terms
Terms
C++ Programming
Identifiers
Built-in Types
True / False Type Keyword 9.1111119
1 byte Boolean --> bool 8 byte
Character --> char
Integer --> int
Floating point --> float
Double floating point --> double
'c' , 'd' , 'D' Valueless --> void 10.6f, 0.01f
1 byte 4 byte
1000, 56, 1
2 byte
Data Types
Built-in Types
Type Keyword
Boolean --> bool
Character --> char
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Integer --> int
Floating point --> float
Double floating point --> double
MSB
Valueless --> void
LSB
A variable is a name which is associated with a value that can be double salary = 51000.99191;
changed.
Variable
Main Memory
Age
2000 0100 1100
Local Global
{ int age = 25
int main( )
{
int age;
} }
Inside Block Not inside any Block
Operators
int marks1 = 95; Main Memory
marks
2000 0100 1100
float percentage;
percentage = ((marks1 + marks2) / 200 ) * 100;
Arithmetic Assignment
Operator Example Ope. Example Same As
Logical Comparison
Operator Example Description Operator Example
&& x < 5 && x < 10 Returns true if both == x == y
statements are true != x!=y
|| x < 5 || x < 4 Returns true if, one of > x>y
the statements is true
< x<y
! Reverse the result ( !True ) = False
>= x>=y
<= x<=y