0

I am using Sublime to program in C but when the code is compiled it keeps returning [Finished in 1.1s with exit code 10]. What does that mean? What is going on?

#include <stdio.h>

void main() 
{
    int x;
    scanf("%d", &x);
    printf("%d", x);
}
MattDMo
  • 100,794
  • 21
  • 241
  • 231
StillBuggin
  • 280
  • 1
  • 3
  • 14

1 Answers1

2
    #include <stdio.h>

int main() 
{
    int x;
    scanf("%d", &x);
    printf("%d", x);
    return 0;
}

main( ) does not take void as a return type.In C programming language we use int as a return type of main .Exit codes are nothing but Windows System Error Codes .I think you are using windows Operating system and for windows Operating system

exit code 10 means :The environment is incorrect.

May be your installation process was not correct . Reinstall it and run the program .

Reezoo
  • 180
  • 8
  • Technically, the `return 0;` statement is implicit as per the C Standard C99 and later. But the Microsoft C compiler is not C99 compliant... – chqrlie Dec 06 '15 at 00:17