Computer Science, asked by adityamishra99, 1 year ago

can a variable name can be started with a digit or any special character​

Answers

Answered by KshithijBK
1

Generally names of variables should be simple and easy to remember. It helps in understanding the code and flow of instructions. Generally every project has some naming conventions which they follow.

Sometimes we need to mark some variables as important, and starting the names with _ provides a distinction.

Allowing more special characters in beginning would only cause confusing names, as per language developers and hence they were not supported.

lets assume if '+' symbol is allowed.

then  ++i would have different meanings in different scenarios. It might be a  name of variable , also It could mean increment operator.

To avoid such confusions, generally other symbols are not supported

Mark as Brainliest PLEASE

Answered by kavyaa0105
0

According to the rules of C++ for naming a variable, it is a valid name. It is not a valid variable name because it has a digit as the starting character. A variable name must begin with an alphabet or underscore, but not numbers or special symbols.

Hope it helps u

Similar questions