Interviews Questions, Algorithms, Aptitude, C Interview Program, C Theory Question, Aptitude Tricks, Test Series,

Thursday 1 July 2021

Interview Hack#34 Answer


What will be output when you will execute the following c code?

  1. Network
  2. N
  3. Garbage value
  4. Compilation error
  5. None of the above

Correct answer 3) Garbage value

Explanation:
The size of a character array should one greater than the total number of characters in any string which it stores. In c every string has one terminating null character. This represents the end of the string.
So Network String Has 8 characters which out of array size so it will print Garbage Value.

0 comments:

Post a Comment