🎴 Flashcard Mode

Programming Languages History and Concepts

Card1 / 20
Mastered0
Review0
QuestionClick to flip

What will be the output of the following program : void main() { char str[]="C For Swimmers"; printf("%d",sizeof str); }

AnswerClick to flip back
A
15
💡 Explanation:

sizeof returns the size in bytes, including the null terminator. 'C For Swimmers' has 14 characters plus 1 null terminator = 15 bytes. sizeof str is evaluated at compile time as 15.

Change Mode