Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


Description:
  Pass entered code as exit code.
Language: C/C++
Code:
#include <stdio.h>
int main(int argc, char *argv[])
{
  int code = 0;

  char r = 0; // rest chars



  printf("The entered code will be passed as exit code!\n");
  printf("Enter code: ");



  scanf("%d%c", &code, &r);



  printf("The program will be terminated with code {%d}.\n", code);

  printf("Press ENTER to exit...\n");



  while (getchar() != 10);



  return code;


}
          
Comments: