C Programming Me Variables Kya Hota Hai

C programming me variable kya hota hai (Variable इन C प्रोग्रामिंग) isse kaise declare kiya jata hai. C programming me variable declaration ka bahut hi importance hai. Iske bina hum koi bhi program write nahi kar sakate. Ye ek basic term hai isliye ye concept ko aapko understand karana hoga.

Variable in C Programming Hindi Me

Variable Kya Hai?

Definition:    "Variable is nothing but a reserved memory block which is used to store different types of values and which value can change in execution of the program."
Variable yane reserved memory block hota hai jo kisi value ko store karane ke liye use ki jati hai. Simple bhasha me kaha jaye to variable yane Name hota hai.



Syntax For Variable Declaration:
Varible kaise declare kiye jate hai uska basic syntax hai.
Data Type Variable Name
Kisi bhi variable ko declare karane se pahale hume uska data type batana padata hai.
Example:
Int a,
Float price,
Is 2 example me int, float data types hai to wahi pe a, price ye variable ka name hai.

Variable Declare Karane Ke Rule:

C programming me variable declare karane ke liye kuch rule banaye gaye hai. Variable declare karate samay hume in rule ko follow karana padata hai.
1. Variable name not start with digit.
Variable name declare karate samay wo number se start nahi kar sakate.
2. Blank space now allowed.
Variable name me blank space allowed nahi hai.
3. White spaces now allowed.
Variable name me white spaces allowed nahi hai.
4. Variable name not be Keyword.
Variable ka jo name hai wo keyword nahi hona chahiye.
5. It is case sensitive
Variable ka jo name hai wo case sensitive hai.


E.g.
Int PRICE,
Int price
ye 2 alag alag variable hai.

Variable Ke Types

Variable ke 2 type’s hai.
1. Local Variable:
2. Global Variable:
1. Local Variable:
Local yane hum jis block me declare karate hai wahi iska use kar sakate hai. Agar humane isko kisi function me declare kiya to wo sirf usi function me use kar sakate hai.
Local variable ko hum value assign karani padati hai system ise default value assign nahi karati.

2. Global Variable:
Global yane hum is variable ko overall program me kahi bhi use kar sakate hai. Global variable ko default value system initialize karati hai.
Agar aap kisi variable global declare karate hai to aap usse kisi bhi function me kitane bhi times use kar sakate hai.



Variable Ko Program Me Kaise Use Karate Hai:

/* Program for understanding variable */
#include <stdio.h>
#include<conio.h>
Void main()
{
Int a=10, b=20,add;
Add=a+b;
Printf(“/n addition =%d, add)
Getch();
}
Upar diye gaye program me humane variable a, b, aur add inka use kiya hai jiska data type integer hai.



Example of Variable:
Int a;
Float salary;
Char c, ch;
To is tarah hum koi bhi variable simple tarike se declare kar sakate hai. Agar aapko kuch problem ho to aap comment ke jariye humare sath share kar sakate hai.
Humare latest updates ke liye facebook page ko jarur like kare.

Author:

Professional Bloggger and Author of Hindimeearn.com Completed Master Degree in Computer Science.Passionate about Blogging,Make Money and Web-Designing.Best Knowledge of HTML,PHP,.NET,C,C++ and other programming languages. Know More About Me...

Follow Us :


Related Posts
Previous
« Prev Post