W.A.P. C++

WAP | CPP | Programs in C++ | C++ Solutions

Snehil Khanor's Binary Log

B.E / B.TECH Result May 2009 MDU


Difference Between a++ and ++a


The difference between a++ and ++a, is that when we use a++ in a program and then the effect would be on the next statement while the ++a, effect is that on the current line not on the next statement.
Output:
Example code:
Select To use this code as it is.. select and copy paste this code into code.cpp file :)
  1. #include<iostream.h>
  2. #include<conio.h>
  3. void main()
  4. {
  5. clrscr();
  6. int a,b;
  7. a=1;
  8. cout<<a<<endl;
  9. cout<<a++<<endl;
  10. cout<<a<<endl<<endl;
  11. b=5;
  12. cout<<b<<endl;
  13. cout<<++b<<endl;
  14. cout<<b<<endl;
  15. getch();
  16. }

Search

About WAP C++

Here you'll find a wide range of programs' solution ranging from beginer level to advanced level.
All programs here are made, compiled and tested by me..and are running absolutely fine.. still if you find any bug in any program do let me know :)

Followers

Subscribe via email

Enter your email address:

Delivered by FeedBurner

my Binary Log



eXTReMe Tracker