You Are Reading

0

C++ Lecture: 14

Unknown Monday 30 July 2012 ,
Lecture 14
Overloading Operator
Code:
#include <iostream>
#include <conio.h>
using namespace std;
int main (int argc, char *argv[])
{
    int a=4;
    cout <<" a value is   : "<< a << endl;
    a++;
    cout <<" a Incremented value is   : "<< a << endl;
  getch();
  return 0;
}
Code view in dev compiler:
Compile the program Ctrl+F9
      Run program Ctrl+F10
Code:
#include <iostream>
#include <conio.h>
using namespace std;
int main (int argc, char *argv[])
{
    int a=4;
    cout <<" a value is   : "<< a << endl;
    a--;
    cout <<" a Decremented value is   : "<< a << endl;
  getch();
  return 0;
}
Code view in dev compiler:
Compile the program Ctrl+F9
      Run program Ctrl+F10
Code:
#include <iostream>
#include <conio.h>
using namespace std;
int main (int argc, char *argv[])
{
    int a=4;
    cout << "It is a condition check \n";
    cout <<"It is a true : "<< (a>1 && a==4) << endl;
    cout <<"It is a false : "<< (a>1 && a!=4) << endl;
  getch();
  return 0;
}
Code view in dev compiler:
Compile the program Ctrl+F9
      Run program Ctrl+F10

0 comments:

Post a Comment

 
Copyright 2010 Learn Dev C++