by Dinesh Thakur Category: Operator

 

#include <iostream.h>

#include<conio.h>;
void main()
{
             int a=1, b=5;
             clrscr();
             cout<<"\nvalue of a";
             cout<< "\nBefore PostIncrement = "<<a;
             a++;
             cout<<"\nvalue of a";
             cout<< "\nAfter PostIncrement = "<<a;
             a--;
              cout<<"\nValue of a";
             cout<< "\nAfter Post Decrement = "<<a;
              cout<<"\nValue of b";
              cout<< "\nBefore Pre Increment = "<<b;
              ++b;
              cout<<"\nValue of b";
              cout<< "\nAfter Pre Increment = "<<b;
               --b;
              cout<<"\nValue of b";
              cout<<"\nAfter Pre Decrement = "<<b;
              cout<<"\n";
              getch();
}
 

illustrates the use of increment and decrement operators



About Dinesh Thakur

Dinesh ThakurDinesh Thakur holds an B.SC (Computer Science), MCSE, MCDBA, CCNA, CCNP, A+, SCJP certifications. Dinesh authors the hugely popular blog. Where he writes how-to guides around Computer fundamental , computer software, Computer programming, and web apps. For any type of query or something that you think is missing, please feel free to Contact us.