Computer Science, asked by BKSs9219, 1 year ago

Which of the following are invalid variable names and why?
a) roll-no or noll_no
b) interest_paid
c) SUM
d) none of these

Answers

Answered by Anonymous
18
sum.is the valid name bcoz it starts from capital letter and ends too.....so the right and will be sum....hope it helps u
Answered by smartbrainz
5

The invalid variable, from the following are roll-no or noll_no and SUM.

Options (a) and (c)

Explanation: 

  • Variable names in programming languages follow some basic and common conventions.
  • Variable name should start with a letter,numbers can be included later on.
  • Underscores(_) are used for clarity.
  • Should not have any special characters.
  • There should be no spaces in between.
  • Variable name should be meaningful.
  • Variable name ideally, should not be a name that is assigned to an inbuilt function or method.
  • Here, roll-no has a special character in-between and noll_no does not make any sense. 'SUM' is normally an inbuilt function that gives the sum of two or more numbers. Hence, this should not be used as a variable name.
  • interest_paid seems to be the only valid variable name here.

To know more about variable names, visit:

https://brainly.in/question/12742188

Similar questions