Tuesday, 24 February 2015

Shortand Assignment Operator in C++

#include<iostream.h>
#include<conio.h>
main()
{
int a=5;
clrscr();
cout<<"\n A+=5 "<<(a+=5); /* a=a+5 or a+=5 */
cout<<"\n A-=5 "<<(a-=5);
cout<<"\n A*=5 "<<(a*=5);
cout<<"\n A/=5 "<<(a/=5);
cout<<"\n A%=5 "<<(a%=5);
getch();
}

No comments:

Post a Comment