Answer to Question #301797 in C++ for Izha

Question #301797

3. Input + Addition


by CodeChum Admin



Hopefully you haven't forgotten about your previous lesson, because you're going to need it for this one.







Instructions:



Input two integers (one per line) and make sure to store them in variables.


Add the two integers and print out their sum!


Input



Two lines containing an integer on each.



6


6


Output



A line containing the addition of the two inputted integers.



12

1
Expert's answer
2022-02-23T12:18:22-0500


#include <iostream>


using namespace std;
int main() {
	int sum=0;
	int number1;
	int number2;
	cin>>number1;
	cin>>number2;
	sum=number1+number2;
	cout<<sum<<"\n";


	system("pause");
	return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog