Dyskusje Q&A
How to develop a game
-2 głosów
4 odpowiedzi#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 Głos
6 odpowiedziPopularne dzisiaj
Python
1 Votes
Guys help please
0 Votes
Python question
2 Votes
Control flow
0 Votes
HTML
0 Votes
Front-end vs Full-stack
1 Votes
About our Capstone product "Ecocambio" We don't know how to code and how electronics would connect.
0 Votes
Are websites hackable?
1 Votes
Python
1 Votes
C# and sql
1 Votes