How to write in the sublime text?

1

I downloaded the sublime text, and set it to program in c, but scanf does not work, it shows the value of the variable, I can not type.

#include <stdio.h>

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

I can not type.

2147323904[Finished in 1.1s with exit code 10]
    
asked by anonymous 05.12.2015 / 22:36

2 answers

0

Try putting the following expression at the end of the code:

scanf("%d", &x);

The code would look like this:

#include <stdio.h>

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

It may be that the program, having no further operations to perform, closes automatically.

    
05.12.2015 / 22:56
0

The main () function may not accept void as a return. You can try the following:

#include <stdio.h>

int main() 
{
    int x;
    scanf("%d", &x);
    printf("%d", x);
    return 0
}
    
06.12.2015 / 12:02