Ask Question
24 April, 14:40

T F The exit function can only be called from main.

+3
Answers (1)
  1. 24 April, 16:39
    0
    FALSE

    Explanation:

    The exit function is used to terminate or halt the process.

    Syntax-

    void exit (int status)

    Exit function (exit ()) can be used in any function not only main () and it will terminate your whole process.

    Example - C Program

    #include

    #include

    / / function declaration

    float exitexample (float x);

    / / Driver program

    int main ()

    {

    float a, b;

    printf ("/nEnter some number for finding square / n");

    scanf ("%f", &a);

    / / function call

    b = exitexample (a);

    printf ("/nSquare of the given number %f is %f", a, b);

    /*This will not printed as exit function is in exitexample () function*/

    }

    float exitexample (float x) / / function definition

    {

    exit (0); / /exit function

    float p;

    p = x * x;

    return (p);

    }
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “T F The exit function can only be called from main. ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers