Ask Question
1 October, 07:23

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

+1
Answers (1)
  1. 1 October, 08:03
    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?
Get an answer to your question ✅ “T F The exit function can only be called from main. ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers