1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
lorasvet [3.4K]
4 years ago
10

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

Computers and Technology
1 answer:
ElenaW [278]4 years ago
5 0

Answer:

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.

<u></u>

<u>Example-</u> C Program

#include<stdio.h>

#include <stdlib.h>  

//  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 ) ;

}

You might be interested in
Write a function with this prototype:
sp2606 [1]

Answer:

Following are the code to this question:

#include <iostream> //defining header file  

using namespace std;

void numbers(ostream &outs, const string& prefix, unsigned int levels); // method declaration

void numbers(ostream &outs, const string& prefix, unsigned int levels) //defining method number

{

string s; //defining string variable

if(levels == 0) //defining condition statement that check levels value is equal to 0

{

outs << prefix << endl;  //use value

}

else //define else part

{

for(char c = '1'; c <= '9'; c++) //define loop that calls numbers method

{

s = prefix + c + '.'; // holding value in s variable  

numbers(outs, s, levels-1); //call method numbers

}

}

}

int main() //defining main method

{

numbers(cout, "THERBLIG", 2); //call method numbers method that accepts value

return 0;

}

Output:

please find the attachment.

Explanation:

Program description:

  • In the given program, a method number is declared, that accepts three arguments in its parameter that are "outs, prefix, levels", and all the variable uses the address operator to hold its value.
  • Inside the method a conditional statement is used in which string variable s and a conditional statement is used, in if the block it checks level variable value is equal to 0. if it is false it will go to else block that uses the loop to call method.
  • In the main method we call the number method and pass the value in its parameter.  

5 0
3 years ago
an organization wants to use its computer to make video calls with suppliers overseasename two input and two output device that
ratelena [41]

Answer:

an organization wants to use its computer to make video calls with suppliers overseasename two input and two output device that the organisation must have for this to happen and briefly explain the popruse of each device

7 0
3 years ago
You are asked to write an app to keep track of a relatively small music library. The app should load song information from a dat
gogolik [260]

Answer:

C++ PROGRAM

Explanation:

6 0
3 years ago
which midi keyboard mode allows for one sound on one end of the keyboard and another on the other end
wlad13 [49]

Answer:

Sound button in the scratch

5 0
3 years ago
________ is a hybrid version of Ethernet that uses either 10Base-T, 100Base-T, or 1000Base-T.
Vladimir79 [104]

Answer: ANSWER is B I'm pretty sure

Explanation: hope this help

s :)

7 0
3 years ago
Other questions:
  • Ben uses a table that has few columns. He knows about a particular value in the first column and wants to find the corresponding
    8·2 answers
  • Writers should avoid jargon because jargon ______. a. Takes too long to use b. Limits what ideas can be explored c. Conveys too
    12·1 answer
  • What is a special class of adware that collects data about the user and transmits it over the Internet without the user’s knowle
    14·1 answer
  • For large and complex amounts of information, storing the information is best achieved by using what?
    5·1 answer
  • What is meant by the phrase "backing up your data"?
    15·1 answer
  • What are the correct answers?
    11·1 answer
  • Which UML relationships should be used between a subclass and a superclass? For example, suppose there is an interface or abstra
    5·1 answer
  • What are the characteristics of Instant Search in Outlook 2016? Check all that apply. A)Typing whole phrases makes your search m
    12·1 answer
  • In Python, which comparison operator means "less than or equal to"?
    5·2 answers
  • Edge is a video game featuring interactive extreme sports. The graphics used in the game are protected by
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!