Addition in C++


Q. Write a C++ program for addition of two number.

#include <iostream>       
using namespace std;

int main()
{
	int a,b,c;    
	cout << "Enter the numbers:";
    cin >> a >> b;    
	c=a+b;
    cout << "Addition Of Two Number is:" << c << endl; 
	return 0;  
} 

Q. Write an algorithm to addition of two number.

1. Start
2. Declare three integer variables: `a`, `b`, and `c`.
3. Print a message to the user: `"Enter the numbers:"`.
4. Take input values from the user and store them in variables `a` and `b`.
5. Add the values of `a` and `b` and store the result in variable `c`.
6. Print the message `"Addition Of Two Number is:"` followed by the value of `c`.
7. End the program.



OnlineTpoint is a website that is meant to offer basic knowledge, practice and learning materials. Though all the examples have been tested and verified, we cannot ensure the correctness or completeness of all the information on our website. All contents published on this website are subject to copyright and are owned by OnlineTpoint. By using this website, you agree that you have read and understood our Terms of Use, Cookie Policy and Privacy Policy.