In C when some error occurs then -1 or NULL value is returned and a global variable errno is set with the error code.Hence we use returned values to check errors. We use EXIT_SUCCESS ,EXIT_FAILURE to deal with errors. There are three types of errors syntax, logical and semantic.