Basic Input & Output with C++

#include<iostream>
using namespace std;

int main()
{
    //"<<" is called Insertion operator
    //">>" is called Extraction operator
    int num1, num2;
    cout<<"Enter the value of Number 1 : \n";
    cin>>num1;
    cout<<"Enter the value of Number 2 : \n";
    cin>>num2;
    cout<<"Sum of numbers is : "<<num1 + num2;
    return 0;
}
//OUTPUT:
// Enter the value of Number 1 :
// 60
// Enter the value of Number 2 :
// 40
// Sum of numbers is : 100

Comments

Popular posts from this blog

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

Basic Input/Output & More in C++