22nd Mar 2019, 9:50 AM
Rayeed_leo
Rayeed_leo - avatar
4 Answers
+ 1
Pass the variable n to the call of function as below : cout << times(8, n) << endl; ...... ..... Moreover you should modify the definition of the function as : int times (int x, int n) {
22nd Mar 2019, 10:18 AM
Prokopios Poulimenos
Prokopios Poulimenos - avatar
+ 1
Line 4 : int timesTwo,n(int x) { remove the n Line 7: cin>>n; add it inside timesTwo function body and before call it declare the variable n as int n ---------------- Question : If your function name is "timesTwo" why do you want user to input it ? I think that n should be constant and equal to 2
22nd Mar 2019, 9:58 AM
Prokopios Poulimenos
Prokopios Poulimenos - avatar
+ 1
At last, u taught me something! May Almighty helps u in need
22nd Mar 2019, 10:22 AM
Rayeed_leo
Rayeed_leo - avatar
22nd Mar 2019, 10:09 AM
Rayeed_leo
Rayeed_leo - avatar