Discussions Q&R
Please, help!
1 Vote
2 Réponses#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 RéponsesWrite a static method called weave that that takes two integers as parameters and that returns the result of weaving their digits together to form a single integer. Two numbers x and y are weaved together as follows. The last pair of digits in the result should be the last digit of x followed by the last digit of y. The second-to-the-last pair of digits in the result should be the second-to-the-last digit of x followed by the second-to-the-last digit of y. And so on.
0 Vote
13 Réponses4 Way Collision
4 Votes
14 RéponsesAujourd'hui en vedette
Checking personal activity
0 Votes
Help
0 Votes
Where is the error
0 Votes
Full form of HTML
0 Votes
Which one is better?? And why??
1 Votes
Use of global function in c
0 Votes
Please help me
0 Votes
Game
0 Votes