When variables are created in a C++ program the memory required to hold the variable is allocated from the program stack,and when the variable goes out of scope, the memory which was taken on the...
Type: Posts; User: kiruthika_sri; Keyword(s):
When variables are created in a C++ program the memory required to hold the variable is allocated from the program stack,and when the variable goes out of scope, the memory which was taken on the...
Try with the followings.
main()
{
int a=10;
int b=20;
printf("a = %d\nb = %d\n",a,b);
a =a+b; b=a-b; a=a-b; // This is first way.