C++ program to perform arithmetic sum
In this chapter of C++ program tutorial our task is to :
Write a C++ program to accept user inputs
Perform arithmetic sum operation on the given inputs
Output the required solution on console
Given below is a C++ program to accept user input and perform arithmetic sum operation on it.
using namespace std;
cout<<"Enter the two numbers giving a space"<<endl;
c = a + b;
Enter the two numbers giving a space.
In the above code:
the compiler enters the main function (here int main()), and then creates each of 4 bits of memory space for variables a,b and c.
Then it takes the two integer as input and then store the value of a+b in a new variable c.
The c variable is then displayed in the output screen.
You can see the above code execution and output in codeblocks IDE:
Would you like to see your article here on tutorialsinhand.
program by tutorialsinhand.com
About the Author
- 🔭 I’m currently working on DS Algo skills
- 🌱 I’m currently learning web develeopement
- 👯 I’m looking to collaborate with Oppia
- 📫 Reach me at https://www.linkedin.com/in/sayantan-bose-14134a1a6/
- 😄 Pronouns: his/him
Page Views :
Published Date :