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 :)
- #include<iostream.h>
- #include<conio.h>
- void main()
- {
- clrscr();
- int a,b;
- a=1;
- cout<<a<<endl;
- cout<<a++<<endl;
- cout<<a<<endl<<endl;
- b=5;
- cout<<b<<endl;
- cout<<++b<<endl;
- cout<<b<<endl;
- getch();
- }
1 comments:
I really appreciated with your content and completely agree with you, here also I was visit a company website Digital zona.
Post a Comment