Can sumone help me with this piece of code im close to tearing out my hair
Hello everyone im new to this forum so id like to use this first post to say hello.
Anyway im new to C and am currentley learning the basics. I am trying to create a simple program that will take two numbers from the user, add them together and print the result.
However when i compile and run the below code no matter what inputs i enter the result is always 37814100.
I have no idea why this is happening and after studying the code can only assume its sumthing wrong with my compiler. Can anyone shed some light on this. thanks for your help
int add(int x, int y);
int main(int argc, char *argv)
printf("enter two numbers\n");
printf("Number 1: ");
scanf("%d", &w, "\n");
printf("Number 2: ");
scanf("%d", &p, "\n");
result = add( w, p );
printf("The product of those two values is: %d\n", &result);
int add(int x, int y)