Multiple choice technology programming languages

void main() { printf("Hello"); return 5; printf(" World"); }

  1. I have started hating C now!!

  2. Hello

  3. Compilation Error - Cannot return when return type is Void

  4. Hello World

  5. Segmentation fault

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

The printf("Hello") executes first, printing Hello. The return 5 statement then exits the function immediately - code after return is unreachable. While standard C prohibits return with a value in void functions, GCC allows it as an extension. The output is just Hello.