Sunday 16 October 2011

Chapter 1: [A] Which of the following are invalid variable names and why?



BASICSALARY    _basic   basic-hra
#MEAN      group.   422
population in 2006      over time    mindovermatter
FLOAT      hELLO   queue.
team’svictory    Plot # 3   2015_DDay


BASICSALARY               Valid

_basic                             Valid

basic-hra                         ( - not allowed)

#MEAN                           ( # not allowed)

group.                             (  . not allowed)

422                                 ( only digits not allowed)

population in 2006          ( spaces not allowed)
 
over time                        ( spaces not allowed)

mindovermatter             Valid    

queue.                            (  . not allowed)

team’svictory                  (   '  not allowed)

Plot # 3                           ( spaces and # not allowed)

2015_DDay                    ( starting with digits not allowed)


32 comments:

  1. Which of the following are invalid variable names and why?

    a) interestpaid
    b) si-unit
    c) AVERAGE
    d) percent.
    e) 123
    f) dist in km
    g) ot pay
    h) Name
    i) FLOAT

    ReplyDelete
  2. Which of the following invalid variable names and why
    B&8
    3abc
    Int
    ab@xyz

    ReplyDelete
  3. _basic this is valid but why??

    ReplyDelete
    Replies
    1. It start with underscored which is allowed

      Delete
  4. Which of the following are invalid variable names? Why?
    Int char 6_05
    Calloc Xx alpha_beta_routine
    floating _1312 z
    ReInitialize _ A$

    ReplyDelete
  5. B'day is valid or invalid? But why

    ReplyDelete
    Replies
    1. only _ (underscore) symbol can be used...No other symbols should be used

      Delete
  6. only _ (underscore) symbol can be used...No other symbols should be used

    ReplyDelete
  7. B'day are valid or invalid

    ReplyDelete