Gate2017 ss Q40

0. Consider the following C Program.


 Note – Numerical Type question

  • Option : A
  • Explanation :
    Assume starting address of string is 100 to make the whole expression is easy to understand.

    Note: Whenever we have characters in the arithmetic expressions, we can replace those with their ASCII values
    strlen (100 + x + 11 - x - 1)[assume x has the ASCII value of I]
    ⇒Strlen(110)
    is printed
    It gives address of second last character in the string. So it prints length 2.
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *