answersLogoWhite

0


Best Answer

All variable names must begin with a letter of the alphabet or an underscore ( _ ). The rest of the characters may be any of those previously mentioned plus the digits 0-9.

User Avatar

Wiki User

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

Wiki User

12y ago

first character: letter (a-zA-Z) or underscore

the following characters: letter (a-zA-Z), digit (0-9) or underscore

keywords (if, switch, else...) cannot be variable names.

This answer is:
User Avatar

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What are the rules of defining variable?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

Describe the differences between local and module-level variables?

local Variable A Local variable is a variable whose scope is limited to the Block of the Subroutine defining it. Private Sub Command1_Click Dim a as integer End Sub Module Level Variable A Module Level variable is a variable whose scope is limited to the Form Module defining it. Public Sub Command1_Click Dim a as integer End Sub Global Level Variable A Global Level variable is a variable whose scope can be limited to the entire project defining it. Private Sub Classjnitialize () Dim a As Integer End Sub


Rules in naming variables in programming?

there are various types of naming rule provide for function ,identifier,i.e variables.but naming rule for variable must meet certain condition.. 1.you can easily idenfy what is variable for.for eg.you may use int a;/to store no of student in your prog. but it is better instead of using "a",you can write any of the following definition int stu; or int stu_no; or int studentno; 2.it must be abbreviated.because although modern compiler support 32 char variable but still where you use that variable you have to type that name again &again. so for eg. in the above case int stu_no; is optimal. when these precondition are met then here are some rules for naming a variable: 1.you use only English alphabet,numeric no,& _(underscore). 2.you must start with a alphabet. then you continue with alphabet or numeric or under score.for eg. you can define a variable like int stu_comp_2009;//for no of student 2009 batch. 3.no variable can start with number or _.such naming may cause some compiler do the right job but maximum would not support this.


What is the difference between object and variable?

A variable basically holds a single type literal in memory through defining its type, declaring it, and setting a value to it. If you meant reference variables, they are variables which refer to the memory location of an object previously set.An object is the actual storage space in memory in which some collection of data resides (is stored). Objects 'live' in memory spaces known as 'heaps'.


What is it called when java allows you to declare methods with the same name in a class?

Yes perfectly Legal Reason: The scope of a variable declared inside a method is only till the method's end. So by defining another variable of the same name inside a different method does not create any issues.


What is accumulator in digital logic?

It is a variable or a component of a variable.

Related questions

Defining the variable?

mathematicschoosing a variable to represent an unknown quantity


What is another name for defining a variable?

An unknown


Describe the differences between local and module-level variables?

local Variable A Local variable is a variable whose scope is limited to the Block of the Subroutine defining it. Private Sub Command1_Click Dim a as integer End Sub Module Level Variable A Module Level variable is a variable whose scope is limited to the Form Module defining it. Public Sub Command1_Click Dim a as integer End Sub Global Level Variable A Global Level variable is a variable whose scope can be limited to the entire project defining it. Private Sub Classjnitialize () Dim a As Integer End Sub


Analyze the difference among local module-level and global variables and explain how ActiveX DLLs are created?

Local Variable A Local variable is a variable whose scope is limited to the Block of the Subroutine defining it. Private Sub Command1_Click Dim a as integer End Sub Module Level Variable A Module Level variable is a variable whose scope is limited to the Form Module defining it. Public Sub Command1_Click Dim a as integer End Sub Global Level Variable A Global Level variable is a variable whose scope can be limited to the entire project defining it. Private Sub Class_Initialize () Dim a As Integer End Sub


What is the definition for defining the variable?

choosing a variable to represent one of the unspecified numbers in a problem and using it to write expressions for the other unspecified numbers in the problem.


What are the rules for a positive correlation?

As the explanatory variable increases, the response variable increases


How to display a variable in PHP using echo or print statements?

displaying a variable in php using echo statement? <?php $name="ram"; //declaring and defining the variable echo "$name"; //printing the variable using echo command ?>


What is a set of rules defining how information is exchanged between two devices?

PROTOCOL


Defining a variable syntax?

[storage-class] [const] [type modifiers] type name [= inital-value] ;


When defining a variable in visual basic what key word appear at the beignning of the statement?

Dim x as integer = 7


What is the probability that the random variable has a value less than 5?

That depends on the rules that define the random variable.


What is the difference between variables and rules?

a variable changes a rule doesnt.