Separate a displayed count from termination status

A laboratory startup program compiles successfully and runs to completion. Assume its output operation succeeds. Its exit status reports a termination outcome to the host environment, separately from the displayed message.


C
#include "stdio.h"
#include "stdlib.h"

int main(void)
{
    puts("Samples accepted: 18");
    return EXIT_FAILURE;
}


Report the sample count displayed in the message as an exact integer, the portable termination category as success or failure, and whether C guarantees that the host receives the numeric status exactly 1 as true or false. Use the standard C meanings of the named constants without assuming a particular operating system.

Your answers

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

More Introduction to C Questions: