How to provide input and get out put in CPP with example

Practice # 4
Here I practice how simple ise that to provide the input and get the output in CPP and how cout and cin works with the insertion operator and extraction operator and how to define the variables in a single line. To see the full code click on Read more and get the code.

/*
Here the 'cout' is use for print any value, print any string or show any output value
and likevise 'cin' is use for give or provide any value or input
these two 'cout' and 'cin' use for input and output throught including header file iostream
*/
#include <iostream>

using namespace std;

int main()
{
    int num1num2;
    // '<<' This operator called insertion operator.
    cout<<"Enter the Value of Number 1 =  \n";
    // '>>' This operator called Extrection operator.
    cin>>num1;
    cout<<"Enter the Value of Number 2 =  \n";
    cin>>num2;
    // '=' This operator called Assaignment operator.
    // '+' This operator called Addition operator.
    int sum=num1+num2;
    cout<<"The Total SUM is : "<<sum;
    
    return 0;

}

Comments