76.0k views
4 votes
The exit function can only be called from main.
a. true
b. false

User Firien
by
6.8k points

1 Answer

2 votes

Final answer:

The statement is false; the exit function can be called from any function within a program, not just main, to terminate the program's execution.

Step-by-step explanation:

The statement that the exit function can only be called from main is false. In programming, particularly in the context of C and C++, the exit() function can be called from any function within the program to terminate the program's execution. This function is part of the standard library and it causes the program to exit with a given status code.

User Kansuler
by
7.7k points