Variable in Hindi - Variables In C Hindi

Variable in Hindi – Variables In C language Hindi

C

Variables In C Hindi :- C Variable jab create kiya jata hai tab interpreter dauvara value ko store karne ke liye memory location assign ki jati hai |

Variables In C Language Hindi

C Variable par koi bhi data type ki value store ki ja sakti hai | Example : Number , String, int , float ,Double etc.

Assigning Value To Variable in c Hindi

Jab Ham Variable Create Karte hai C me to sabse pahle hame ye batana hota hai ki ham kis Data type ki value assign karni hai |

For Example

#include <stdio.h>

int main()
{
    int var = 10;
    printf("The Value Is %d",var);
    return 0;
}

Output :

The Value is 10

Changing Variable’s Value in c hindi

C Language me variable ki value change ya re-assign ki ja sakti hai |

Example :

#include <stdio.h>


int main()
{
    int var = 10;
    printf("The First value is %d\n",var);
    var = 20;   // changing value
    printf("The Changing value is %d",var);
    return 0;
}

Output :

The Changing value is 10                                                                                                      
The Changing value is 20

Assigning Single Value to Multiple Variables in C Hindi

C Programming me ek hi value ek se jyada variables par assign ki ja sakti hai |

For Example :

#include <stdio.h>


int main()
{
    double x, y, z;
    x = y = z = 50;
    printf("%f %f %f",x,y,z);
    return 0;
}

Output :

50.000000 50.000000 50.000000 

Aap Upper Diye Gye Output ko dekh sakte hai hamne floating value print karaya hai or ek value ko multiplies variable pr assign kiya hai |

Variables Concatenation in C Hindi

C me ek hi data types ke variables concatenate kiye ja sakte hai |

See Example :

#include <stdio.h>
#include <String.h>

int main() 
{ 
	char First,Second;

	printf("Enter The First String :");
	scanf("%s",&First);
	
	printf("Enter The Second String :");
	scanf("%s",&Second);

	// Appending the string. 
	strcat(First,Second)

	printf("%s",First); 
	return 0; 
} 

Output :

Enter The First String :Master
Enter The Second String : Programing
Master Programing
Variable in Hindi - Variables In C Hindi

Types of Variables In C Hindi

Variables In C Hindi – C Programming me variable ke two type hote hai|

  • 1 . Local Variables
  • 2 . Global Variables

1 . Local Variables

Local Variables, functions ke under hote hai| unki visibility sirf function ke under hoti hai, jab wo function ke bahar aate hai tab destroy ho jate hai| Isse Ham Or Accha Samanjh ne kiye Iska Ek Example Dekhte Hai |

For Example :

#include <stdio.h>

int multiply(int a, int b)
{
        return a * b;
}

int main() 
{
        int x = 3, y = 5;
        int z;
        z = multiply( x, y );
        printf("%d",z);
        return 0;
}

Output :

15

2. Global Variables

Global Variables , function ke bahar hote hai | unki visibility function ke under or bahar hoti hai| unka scope pure program par hota hai | Isse Ham Or Accha Samanjh ne kiye Iska Ek Example Dekhte Hai |

Source Code :

#include <stdio.h>

int g;

int main(){
	int a = 4;
	g = a * 2;
	printf("%d",g);
	return 0;
}

Output:

8

C Variable in Hindi

C Variables Example Me local or global ye dono variables declared kiye gye hai | function ke bahar ka variable local hai | or under ka variable local hai | global variable ka scope function ke under or bahar hota hai lekin function ke under alag se variable declaration hone ke karan func() call karte hi variable ki value change ho jati hai|

Variables In C language Hindi

Also Read This Post

Leave a Reply

Your email address will not be published. Required fields are marked *