Hi @Reem Elhady ,
There are some problems with this code, and main()
is an integer, so it needs a return value.
cout << "The sum is. . . " << sum;
end1;
I suggest you to refer to the following code:
#include<iostream>
using namespace std;
int main() {
int num1;
cout << "Enter the first number.";
cin >> num1;
int num2;
cout << "Enter the second number.";
cin >> num2;
int sum = num1 + num2;
cout << "The sum is. . . " << sum << endl;
return 0;
}
Best regards,
Elya
If the answer is the right solution, please click "Accept Answer" and upvote it.If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.