So the students i shall provide you the basic concepts of programming through which you will able to write and understand the programming codes.
Firstly I shall provide simple and easy information about these following topics.
- Declaration of Variables:-
- Data Types:-
- Difference B/W Initialization,Declaration and Assignment of variable:-
- Comments:-
- Loops:-
Variables are the basic and an important part of any computer language.We store values according to our need and then use these variables in the code to perform operations and get desired information.
There are some instruction or rules to declare a variable.These are as follows:-
- Variable name can be 1-30 character long.
- It can include A-B,0-9 and special characters.
- The name of variable cannot be start from a number.
- The name of variable can start from special character.
- Space cannot be used in the name of variable.
- _ is used at the start of variable name.
In the Following picture you will be clear about Variable.
According to syntax you can verify that the variable declared in the pic is correct.
This process of declaring a variable is called initialization.
Declaration , Initialization and Assignment of variable:-
There is a minor difference between declaration and initialization of a variable.
In declaration of variable we declare a variable only and give no initial value to the variable.It means that we define only data type and name of variable in declaration.But in initialization we give a initial value to the variable but at the time of declaration of variable.
Following picture explain the difference between declaration,initialization and assignment:-
In above picture we declare a variable named "a" having type "int" and store value "10" in this variable.
No comments:
Post a Comment