First, be sure to return the return code from the main function main (), using return(0) or exit(0) .
Second, puts(A); takes as an argument a string (a pointer to a string), then adds a new string character to this string \n and outputs the whole thing to STDOUT, I mean, on the screen.
If, instead of a string, you pass a number to puts , then the function will consider this number as an address for a string, as if located at that address. But in fact, an attempt is made to access an arbitrary memory cell, to which, with high probability, the program does not have access. Therefore, the OS will block this attempt and issue an error: Segmentation fault .
Thirdly, what needs to be fixed? It depends on what you need to get in response. Print the number? For these purposes, as already stated in another answer, printf is suitable. If you really need to use puts , then you need to do a number to string conversion. Alternatively, you can use sprintf.