Обсуждения
#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 голос
6 ответовАктуальное сегодня
Ai generated practices
2 Votes
Where did mess up....
1 Votes
Feedback on my portfolio
0 Votes
Yo this is madness
0 Votes
Solving coding challenges
0 Votes
How can i insert files?
1 Votes
Advertising in Sololearn
0 Votes
Hi who can hel me please
0 Votes