answersLogoWhite

0


Best Answer

we can declare a variable using the following syntax

datatype variablename;

actually variable is the name given to the memory location which store values.

User Avatar

Wiki User

โˆ™ 2012-06-26 10:02:53
This answer is:
User Avatar
Study guides
๐Ÿ““
See all Study Guides
โœ๏ธ
Create a Study Guide
4.25
โ˜†โ˜…โ˜†โ˜…โ˜†โ˜…โ˜†โ˜…โ˜†โ˜…
12 Reviews

Add your answer:

Earn +20 pts
Q: How do you declare correct variable in c?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How you declare a variable in c language?

you have to give a statement in the following syntax datatype variable;


How do you declare a variable in c language?

you have to give a statement in the following syntax datatype variable;


How do you declare a variable in C and C plus plus?

Declare the type (int, char, double, etc) followed by the name of the variable. The variable name is a reference to the memory allocated to the type being declared. If the variable is a pointer to the type, precede the name with *. In C++, you may also initialise variables in the declaration.


What is the syntax to declare the variable in c?

Simplest case: the;A more difficult case: the [];


How you declare a Pointer variable in C?

Use the pointer operator (*) immediately after the type.


How do you use define in C?

Just type declare then the variable that you desire to assigned a certain constant value on it. Just type declare then the variable that you desire to assigned a certain constant value on it.


Why can you not declare void variables in c?

void, in C, is a type that has no size. Thus, if you were to declare a variable of type "void", the compiler would not know how much memory to allocate for it.


What does a constant do in c plus plus?

A constant is a variable that does not change. The correct term is constant variable.


How do you declare an integer variable?

datatype variable name;


Is it corrrect to declare a variable in c or c plus plus as two or three words for eg int seg no?

No., If you want to declare you jus use _ in between so the declaration will be like int seg_no;


Why all variables are declared with in the function?

It is not necessary to to declare variables inside the function in C. If you declare a variable inside a function, the variable becomes local for the function and another variable of same name can be declared in any other function, but you can not use the variable declared in other function. When you declare any variable outside the function body then the variable becomes global and can be used in any function of the program. Note: errno is an example for a variable declared outside any function.


Why you use static class in c?

static is not a class it is a storage class which is used to declare a local-scope variable.

People also asked