Basic Input/Output & More in C++

 #include<iostream>

using namespace std;

int main()
{
    int num1,num2;
    cout<<"Enter the value of num1 : \n";
    cin>>num1;
    cout<<"Enter the value of num2 : \n";
    cin>>num2;

    cout<<"The sum is : "<<num1+num2;
    // '<<' is called Insertion operator
    // '>>' is called Extraction operator
    return 0;
}

OUTPUT:
PS D:\C++> > cd "d:\C++\" ; if ($?) { g++ tut5.cpp -o tut5 } ; if ($?) { .\tut5 } Enter the value of num1 : 3 Enter the value of num2 : 8 The sum is : 11 PS D:\C++>



Comments

Popular posts from this blog

Control Structures, If Else and Switch Case Statements in C++