Wednesday, December 7, 2011

Not using namespace std! Demo

#include<iostream>

//using namespace std;


// :: is scope resolution operator

int main()
{
  int a,b;
  std::cout<<"Enter two numbers : ";
  std::cin >> a >> b;

  std::cout << endl <<"Sum of " << a <<" and "<< b <<" is "<< a+b;

  return 0;
}

No comments:

Post a Comment