Im 15 years old and just starting out with programming. I was wondering if anyone could help a begginer out with a simple code. Basicly im adding 2 integers together, 1 is already set and the other i get from the user. If the 2 integers are equal i want a certain message to dislplay, but for some reason when i use "if" it just displays the message regardless of the value. It also will not add. Here is the code.
int one(int a, int b,int ans);
int main(int argc, char *argv)
printf("Hello, my age is %i years old, what is your age?\n", b);
int one(int a, int b, int ans)
printf("You say your age is %i? Hey we are the same age!!!\n",a);
printf("This gives us the combined age of %i\n", a);
printf("You say your age is %i, this makes are combined ages %i.\n", a, ans);
when i compile and run the program without the message it will state the age of the person and the combined ages like its sopposed to. when i compile it with the "if" in there it says the "if" message no matter what and instead of adding the 2 numbers it just repeats the second. Thanks for the help.