Home / C Programming / Declarations and Initializations :: Discussion

Discussion :: Declarations and Initializations

  1. Which of the following special symbol allowed in a variable name?

  2. A.
    * (asterisk)
    B.
    | (pipeline)
    C.
    - (hyphen)
    D.
    _ (underscore)

    View Answer

    Workspace

    Answer : Option D

    Explanation :

    Variable names in C are made up of letters (upper and lower case) and digits. The underscore character ("_") is also permitted. Names must not begin with a digit.

    Examples of valid (but not very descriptive) C variable names:
    => foo
    => Bar
    => BAZ
    => foo_bar
    => _foo42
    => _
    => QuUx


Be The First To Comment