answersLogoWhite

0

What do you mean by variable in c?

Updated: 8/10/2023
User Avatar

Wiki User

12y ago

Best Answer

scope of a variable is the part of the code within which the variable is defined or the part of your code within which the th variable can be used for example

#include<stdio.h>

void main()

{

int variable1

}

now this variable (variable1) that we have used can be used anywhere within the main function .but if i write a code as shown below

#include<stdio.h>

void function1(int a)

void main()

{

int variable1

}

void function1(int a)

{

sum=variable1+variable1;

}

the compiler wouldn't know what variable1 ,being used in function1 is.

we therefore say that variable1 has a scope within the main only

if however we would have written int 'variable1' immediately after #include<stdio.h> then 'variable one would have been a global variable and could have been used anywhere within the code

User Avatar

Wiki User

13y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

10y ago

A variable is a named memory location, used to store various types of data. The type of variable determines its size in memory, range of values that can be stored in it and type of operations that can be performed on it. A variable name can be created using letters, digits and underscore character. All variables should start with a letter or an underscore character and must be declared before using them in a program.

This answer is:
User Avatar

User Avatar

Wiki User

12y ago

variable is the one whose value changes frequently during execution of the program.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What do you mean by variable in c?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

What does increments mean in C programming?

It has nothing to do with C, it simply means: add 1 to a variable.


Why you use count in simple interest program in c?

You mean 'count' as variable-name? It is optional.


How do you swap in c programming?

the simple way can be explained by example as: let there be two integers as : int a=10,b=5; if we want to use third variable then let third variable be int c; and sorting is done as : c=a; a=b; b=c; if it is to be done by without using third variable then : a=a+b; b=a-b; a=a-b; at last the variable is sorted.


What is c a variable for in physics?

Speed of light.


What is static char in C?

static storage class in C tells that: The variable will have the default value as zero. The variable scope will be the file in which it is defined. RaVi

Related questions

What does c x b mean?

The variable c times the variable b simply equals cb. Just as the variable x times the variable y would equal xy, and so on.


What does increments mean in C programming?

It has nothing to do with C, it simply means: add 1 to a variable.


What do you mean by initialization in c plus plus?

Not initialized variable: int myInt; Initialized variable: int myInt = 10;


When an experiment showes that one variable makes another variable change and no other variable has any effect what is the experiment showing?

causation


Why you use count in simple interest program in c?

You mean 'count' as variable-name? It is optional.


In a graph what is the variable on the horizontal axis?

Independent Variable c:


What is the variable of a cloud?

c


What variable represents specific heat in the equation mcT?

variable c


What is Variable Scope?

The scope of a variable is the range, or area, in which a variable exists. // this c is global and can be referenced from anywhere int c = 1; void foo() { // this c is local to function foo and can't be referenced from the outside int c = 2; } void bar() { // if we try to reference c here, we get the value 1 from the global variable }


What does 12 equals p of c mean?

If we're talking strictly algebra. 12 equals p of c can be written as: 12= p(c) meaning, 12 is the answer for some function p, when c is the variable.


What is a variable in C language?

variable which is used to specify the values and also we can that values through the variable name


What is the difference between object and variable in c?

There is no objects in C.