Ask Question

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

+4
Answers (1)
  1. 12 April, 01:55
    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 & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers