+ 2

Please tell me how to remove error

#include <iostream> using namespace std; int func(int m=10,int n){ int c; c=m+n; return c; } int main() { cout<<func(5); return 0; }

5th Dec 2017, 11:26 AM
Anuj kumar
Anuj kumar - avatar
2 Answers
+ 5
In line 3, You have to declare constant at last, it is necessary to declare variables first in function parameters Solved: int func(int n, int m = 10){
5th Dec 2017, 11:46 AM
#RahulVerma
#RahulVerma - avatar