The exit() statement, C Language Assignment Help

Assignment Help: >> Loop Control Statement >> The exit() statement, C Language

The exit() statement 

The break statement just terminates the execution of a loop or a switch-case construct in which it occurs. The exit() function terminates the execution of the program itself. The exit() is a standard library function and stdlib.h is the header file of exit(). The process.h can also be used instead stdlib.h.

Example:

main()

{             

int i;

                for(i = 1; i < = 100; i ++)

                {             

                               printf("%d\t", i);                               

                               if(i = = 3)

                                                exit(1);

                }

                printf("Out of loop");

}

The exit() requires an integer argument. As the if condition is satisfied exit() would terminate the execution of the program without executing the rest of the statements in the program.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd