The code works as you wrote it.
What is happening is that you defined the variables a, b, and c. The variables a and b have no values, but should be 0. You told the compiler to add a and b together and assign the result to c.
Wellllllll, that code only works once. You're NOT telling the compiler to use this as a formula that say "this is how you always determine the value of c". There is no such thing as defining a formula like this in C, or any other language that I know of.
You have to run code that makes that calculation AFTER you get the values of a and b from the user.
int a, b, c;
c = a + b;