C++ Program:

- To print the sum of 2 numbers

Example:

User Input: 2,3

Output: 5

#include <iostream>
using namespace std;

int main() {
  int n1, n2;
  cout<<"Enter two numbers: ";
  cin>>n1>>n2;
  cout<<"Sum :"<<n1+n2;
  return 0;
}

Output:

  Enter two numbers : 7
  5
  Sum : 12
Program
basic

Here, we use 2 variables (above code n1 & n2) to take numbers from the user

Now, Just use the add(+) operator to print the sum of the numbers

cout<<n1+n2; //use add(+) operator

For devision (/), subtraction (-), multiplication (*), you can use their respective operators

Concept

Coming Soon !

Quick
Tutorial

Quote

The best preparation for good work tomorrow is to do good work today.