Operators:-
Operators are predefined token symbols which are performed some computational works between variables, constants, objects is an expression. This operators have different meanings at different place . There are different types of operates.
1. Arithmetics
2. Relation
3. Logical
4. Assignment etc
➡️ Punctuators :-
C++ use some of the special characters in its coding punctuators . This are [ ], { },( ) ,•, //, # etc.
➡️Identifier:-
Identifier is also meaningful word of programming language like keywords but keywords are predefined, but identify are created by user (programmer) the scope of identify is limited only within a program, were we have created it, but keywords can be used in the all program of c++.
Example:- variable ,functions, classes and object etc.
➡️Variable:-
Variable is one of the very common used in c++ which is used to store (Hold).The value the number of value is required in a program be have to make that much number of variables. The value of variables is cannot fixed, it can change.
A variable nothing but a name given to storage area that our programs can manipulate.
As we know that variables are Identifiers so we have to create it, the process of creating variable called variable declarating it involves
1. Naming a variable
2. Declaring its type
3. Declaring its size.
1.Naming of variable:-
We must give a name to variables before using it. So that If identifier .We can give any name to the variable by considing the following rules.
i) Variables name are Case - sensitive means
capital character and is small character both considered different.
ii) We can not create more than are variable of the same name in a program,
iii) There should not be extra character in the name of variable and underscore can be used their .
iv) There should not be any space in the name of variables .
V) Any key word cannot be variables name .
Vi) Variable name should not begin with digit in between or at least digit can be used.
📑Note:-
we can give any name to the variable but We should always gives meaningful name .so that its become easay to understand .
Type of variable :- We also declare which type of value and data variable is going to store this is also called Data tyor of variable.
For these we have to understand type of data Is possible in c++there are basic three types of data:-
i. Integer or Numeric:- it Startes numeric data
for example:- Roll number,quarter number, personal number etc.
ii. Floating point/Decimal:- Floating point is used to store decimal value.
iii. Charcter/alfa numeric:- The character variable can store alfa numeric and and extra characters and we can say everything but,we can not do mathematical calculation with it.
DATA TYPE:-
1. Interger /numeric:-
example:- 1700480500 ,
keyboard:- int ,long int, unsinged int.
2. Floating point :-
example:- 1.4 , 3.14 , 70 , 453.78
keyboard:- float , double , long double.
3. Character/alfa numeric:-
example:- a,b,x,d, I Like C++ So Much, #,%.
keyboard:- character unsinghed,character.
NOTE:-
Integer and decimal variable can be calculated but character can not .
Size:- We also have to decrare size and range of data the the variable is gonig to accept
For Example:- Int can store -32768 to 32767
So, its size is a 2 byte where long int store
-247483648 to 2147483647 and its its size is 4byte. Similarly float and double at same type of difference .
0 Comments