New course! Every coder should learn Generative AI!
Try a free lessonQ&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 AnswersWrite a C program to mimic the popular game tic-tac-toe for two players. It takes positions as input from both the players and put appropriate symbols for respective players. Eventually it checks the winning combinations for the players and prints the result in favor of Player one or player two or declares draw.
0 Votes
2 AnswersHot today
Is there anyone help me to make a code I can't understand how to build it so anyone help me plz.
0 Votes
Chess Tournament Python code
1 Votes
help
0 Votes
Let Const Var
2 Votes
C++ query ,help me
1 Votes
About code
0 Votes
Quick question 🤔
1 Votes
Was i wrong ?
0 Votes
Code not working
0 Votes