323 views
4 4 votes

A C program contains a call to a function named $\verb|calculate_area|$  in  $\verb|main()|$, but the function definition itself is entirely missing from all source files and linked libraries.

What type of error will most likely be generated, and at which stage of the program creation process?
 

  1. A COMPILER error during the COMPILATION stage.
     
  2. A LINKER error during the LINKING stage.
     
  3. A SYNTACTIC error during the PREPROCESSING stage.
     
  4. A RUNTIME error after the program is EXECUTED.

3 Answers

4 4 votes
Well, compiler won't have any issues as tokens will be generated and since there's no mistake in syntax or wrong writing compiler will proceed with compilation stage.

But after that when linker will start linking every libraries to the file it will read fn call and will start to look for the defination but it won't get thus it will throw linker error

Syntax error cannot happen as there's no wrong code written.

Runtime error cannot occur as the execution won't start linker will not let to pursue execution.

Thus option #B# is the answer
0 0 votes

Error Type: The error generated is an unresolved external symbol error, which is a classic LINKER error.

Answer:
Position:
Show:

Related questions

3 3 votes
2 2 answers
355
355 views
GO Classes asked Dec 9, 2025
355 views
Consider the following multi-line C code snippet: int *ptr_arr[MAX_VAL], x = 0; /* Token counting starts from the next line */ do { ptr_arr[x] = &x; } while ((x++ < M...
2 2 votes
2 2 answers
347
347 views
GO Classes asked Dec 9, 2025
347 views
The number of tokens in the following C statement isif(ptr->count++ >= 10 && !flag) $11$ $12$ $13$ $14$
3 3 votes
2 2 answers
330
330 views
GO Classes asked Dec 9, 2025
330 views
Consider the following context-free grammar:$E \rightarrow T E^{\prime}$ $E^{\prime} \rightarrow+T E^{\prime} \mid \epsilon$ $T \rightarrow F T^{\prime}$ $T^{\prime} \rig...
2 2 votes
2 2 answers
358
358 views
GO Classes asked Dec 9, 2025
358 views
Consider the following context-free grammar:$A \rightarrow b B C$ $B \rightarrow d \mid \epsilon$ $C \rightarrow a \mid f$ What is $\operatorname{FOLLOW}(B)$ ? $\{C\}$ $\...