Computer Science, asked by kishancric249, 3 days ago

What is variable and write ar rules and guidelines for naming variables

Answers

Answered by amanrajbadajena222
1

Answer:

Rules for naming variables:

All variable names must begin with a letter of the alphabet or an. ... After the first initial letter, variable names can also contain letters and numbers. ... Uppercase characters are distinct from lowercase characters. ... You cannot use a C++ keyword (reserved word) as a variable name.

Answered by itxhorror
0

In simple terms:- A variables are used in equations lke a , b , c , x ,y and any letter of abcd is considered as variable

Rules for defining variables:-

A variable can have alphabets, digits, and underscore.

A variable name can start with the alphabet, and underscore only. It can't start with a digit.

No whitespace is allowed within the variable name.

A variable name must not be any reserved word or keyword, e.g. int, goto , etc.

Rules of naming variables:-

Name your variables based on the terms of the subject area, so that the variable name clearly describes its purpose.

Create variable names by deleting spaces that separate the words. ...

Do not begin variable names with an underscore.

Do not use variable names that consist of a single character.

Similar questions