Hey guys..so my prof gave me this question but am confused. So check this out....Write a program that ask a user to enter three values then the program should add 7 to the first value,multiply the second value by 3 and subtract 9 from the last value using a function. The program should call the function in the main program and display the new values.
You're almost fine except for calling your functions and your use of cin and cout.
1 2 3 4 5
cin >> a >> b >> c; // Use successive operators, not comma
cout<<add (a) << '\n'; // Again use successive operators and quote the newline
cout<<product (b) << '\n';
cout<<subtraction (c) << '\n';
Note that x, y and z are not defined when you call your functions. Because you define default values for the second argument of each of your functions, it is not necessary to supply the second argument.
PLEASE USE CODE TAGS (the <> formatting button) when posting code.
It makes it easier to read your code and also easier to respond to your post. http://www.cplusplus.com/articles/jEywvCM9/
Hint: You can edit your post, highlight your code and press the <> formatting button.