0
How to add 2 numbers??
3 ответов
+ 5
By using the plus sign.
Looks like: +
Example/
int sum = 5 + 2;
+ 2
(in C++)
#include <iostream>
using namespace std;
int main() {
int a = 15;
int b = 10;
cout << (a + b);
return 0;
}
replace a, b, 10 and 15 with something of your choice
if you want the sum of what the user writes:
#include <iostream>
using namespace std;
int main() {
cin >> a;
cin >> b;
cout << (a + b);
return 0;
}
again, replace a and b with something of your choice
+ 1
Something called plus sign.
Search it on Google...
And if you wanna get more complicated, check this.
https://code.sololearn.com/c31yeylQ5Dnt/?ref=app