Q&A Discussions
#include <iostream>
using namespace std;
int sum(int a, int b=42) {
int result = a + b;
return (result);
}
int main() {
int x = 24;
int y = 36;
//calling the function with both parameters
int result = sum(x, y);
cout << result << endl;
//calling the function without b
result = sum(x);
cout << result << endl;
return 0;
}
why is da last function cout 66 and not 48 isn't it suppose to add 24+24?
1 Vote
6 AnswersOperator % what is it
0 Votes
4 AnswersStop code execution?
2 Votes
1 AnswerThe above qns ans
0 Votes
1 AnswerHot today
Someone can help me
2 Votes
What's wrong with this?
2 Votes
X velocity
0 Votes
HTML community, HELP!!
2 Votes
Files not linking in C++
0 Votes
I am a super beginner
0 Votes
Web Dev
0 Votes
How this program executes?
0 Votes