Operators, variable, constant, special operator in C programming in HINDI
Hello guys , हमलोग आज जानने की कोशिश करेंगे कि Variable, Type of Variable, Constant, Special Operator क्या है और इसका use C Programming में क्यों किया जाता है। शुरू करने से पहले आपको बता दें कि अगर आपने हमारा पिछले content...👉Token In C Programming In HINDI नही पढ़े हैं तो वह पढ़ले जिससे यह वाला content आपको आसानी से समझ में आ जाए तो चलिए शुरू करते हैं।
Variable क्या है!
- Variable एक name या एक memory location है जिसका use करके value को store कर सकते हैं
- यह एक समय पर Different values को store कर सकता हैं
- Program के execution के दौरान हम variable के value को change कर सकते है
- A data type is associated with each variable और यह तय करता है कि variable क्या value ले सकता है
- Variable name केवल एक memory location का symbolic representation होता है
Note :- यहां पर playerScore int type का एक variable है जो एक integer values 75 को assigned कर रहा है
Note:- variable के naming के rules वहीं होता है जो identifier के naming के लिए होता हैं। ज्यादा जानकारी के लिए इस link पर click करें...👉 Token In C Programming In HINDI
Type of Variables in C Programming
Variables बहुत type के होते हैं - Local variable
- Global variable
- External variable
- Static variable
- Automatic variable
Declaration(घोषणा) of variables
- एक variable का declaration यह variable के name और datatype को specifies करती हैं
- एक variable को store कर सकने वाले value का type और range इसके datatype पर depends कर सकता है
The syntax of Declaration of a variable is :-
datatype variable name ;
- यहां पर datatype में int, float, char, double हो सकता है
int x;float salary;char grade;long y;short z;
- यहां पर x एक variable है जिसका type int है।
- salary एक variable है जिसका type float है।
- grade एक variable है जिसका type char है।
Note :- The datatype, short int और long int को only short और long मे लिख सकते है।
इसलिए यहां पर y variable को long type int में और z variable को short type int में declare किया गया है।
Note :- एक से अधिक variables को single declaration में declare कर सकते है।
Ex:- int x,y,z,total;
- यहां पर x, y, z और total ये सभी variable है जिसका type int है।
Note :- It is must to declare a variable before it is used in the program.
Initialization(प्रारंभ) of variables
- जब किसी variable को declare किया जाता है तो उसमें undefined value होता है जिसे commonly( आमतौर) garbage value कहां जाता है।
- अगर हम चाहे तो declaration के दौरान variable के लिए कुछ initial value को assign कर सकते है इसे variables का declaration कहा जाता है।
int a= 8;float x=6.9, y=12.3;char ch= 'y';double num=0.15197e-7;int 1,a, b, total=0;in the last declaration, only the variable total is initialized.
0 टिप्पणियाँ
अगर ऊपर दिए गए पाठ में आपको कोई Doubt है , तो Comment करे हमारी Team जल्द ही आपकी सहायता करेंगी।