Multiple choice

What type of error is encountered when the following program is executed?

#include<iostream.h> void mail() { cout<< have a nice day ; }

  1. Runtime error

  2. Compiler error

  3. Linker error

  4. Syntax error

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

The code has a typo: 'void mail()' instead of 'void main()'. This creates a linker error because the linker looks for the main() function as the program entry point but can't find it. The program compiles successfully but fails during linking. This is a common error that occurs when the required main() function is missing or misspelled, preventing the program from being properly linked into an executable.