I think you messed up between C and C++ compilers and you are compiling the c program in a C++ compiler. Compile the program as C instead of C++
Moreover, you need to correct/maintain the recent days' convention to write a program. As you are prototyping a method, you need to add the function name at the top of the main function with its data type. Keep in mind, it is better to initialize variables rather than assign. Remove the exit(0) from the code and put return 0 as I can see you didn’t add <stdlib.h> header in your program.
Let me put all the things in my way.
int add_two_numbers(int x, int y);
int num1 = 10;
int num2 = 25;
int add_two_numbers(int x, int y)
int z = x + y;
Now, the program should run fine and produce an output: