answersLogoWhite

0

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.

User Avatar

Wiki User

13y ago

What else can I help you with?

Related Questions

What are variables in programming?

In computer programming, variables refer to a particular location in the memory that holds a value. Variables are equivalent to their assigned values.


What format is used for identifying or naming classes?

Classes in programming are typically named using a naming convention called UpperCamelCase, where each word in the class name starts with an uppercase letter. This format helps differentiate class names from variables and functions.


What are the rules for naming new elements?

The IUPAC rules for naming new chemical elements are at this link.


Is internet programming really different from other programming paradigms?

By definition, each "programming paradigm" is different from every other one, but they all share some common features and attributes. Most have at least a lexicon, syntax rules, and variables.


What is a coding manual?

Coding manuals, also known as programming standards manuals, are used to define the standards associated with programming in a particular environment. A coding manual will provide standards for: * Variable Naming * Subroutine/Function Naming * Comments * Nesting (e.g., how to reflect loops, if statements, etc.) * Structure (e.g., where global variables are defined, etc.) * Code Reviews and other standards that might be specific to a particular programming environment.


What are the naming rules on Microsoft Word 2007?

Upper & Lower case letters are the naming rules on Microsoft Word 2007.


What is the prefix for variable?

In programming, the term "prefix" typically refers to a naming convention that precedes the name of a variable. Common prefixes include "int" for integer variables, "str" for string variables, "bool" for boolean variables, and so on. These prefixes help developers quickly identify the data type of a variable.


What are the naming rules in XML?

XML has no rules like html in regards to tags and naming tags, you write your own xml tags.


What type of linear programming can be found by graphical methods?

A linear programming question with two variables. Problems with three can be solved if there is a constraint that reduces them to effectively two variables. Linear programming with 3 variables, using 3-d graphs is possible but not recommended.


What are variables in 3 words?

Variables are placeholders for values. They can change or vary. In programming, they store data.


Can you explain the difference between pointers and variables in programming languages?

In programming languages, variables are used to store data values, while pointers are variables that store memory addresses of other variables. Variables directly hold data, while pointers hold the location of where data is stored in memory.


How are constants and variables important in devoloping java programs?

Without variables, you won't be able to do much programming. Variables is where you store data; such data may change over time. And computer programming is all about manipulating data.