write rules for naming a variable
Share
write rules for naming a variable
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Answer:
Rules for naming variables:
All variable names must begin with a letter of the alphabet or an. underscore( _ ). ...
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.
Rules for naming variables:
➡️Aʟʟ ᴠᴀʀɪᴀʙʟᴇ ɴᴀᴍᴇs ᴍᴜsᴛ ʙᴇɢɪɴ ᴡɪᴛʜ ᴀ ʟᴇᴛᴛᴇʀ ᴏғ ᴛʜᴇ ᴀʟᴘʜᴀʙᴇᴛ ᴏʀ ᴀɴ. ᴜɴᴅᴇʀsᴄᴏʀᴇ( _ ). ...
➡️Aғᴛᴇʀ ᴛʜᴇ ғɪʀsᴛ ɪɴɪᴛɪᴀʟ ʟᴇᴛᴛᴇʀ, ᴠᴀʀɪᴀʙʟᴇ ɴᴀᴍᴇs ᴄᴀɴ ᴀʟsᴏ ᴄᴏɴᴛᴀɪɴ ʟᴇᴛᴛᴇʀs ᴀɴᴅ ɴᴜᴍʙᴇʀs. ...
➡️Uᴘᴘᴇʀᴄᴀsᴇ ᴄʜᴀʀᴀᴄᴛᴇʀs ᴀʀᴇ ᴅɪsᴛɪɴᴄᴛ ғʀᴏᴍ ʟᴏᴡᴇʀᴄᴀsᴇ ᴄʜᴀʀᴀᴄᴛᴇʀs. ...
➡️Yᴏᴜ ᴄᴀɴɴᴏᴛ ᴜsᴇ ᴀ C++ ᴋᴇʏᴡᴏʀᴅ (ʀᴇsᴇʀᴠᴇᴅ ᴡᴏʀᴅ) ᴀs ᴀ ᴠᴀʀɪᴀʙʟᴇ ɴᴀᴍᴇ.