hi ! can someone please tell me the difference between output of given two 
expression in C++ programs , how expressions are evaluated  in these two cases?

#include<iostream.h> 
void main() 
{  
int m=5,v=0,u=0; 
v=v+(m++)+(++m);  
cout<<v<<endl;    //output is 11 
} 

#include<iostream.h> 
void main() 
{  
int m=5,v=0,u=0; 
v=(m++)+(++m); 
cout<<v<<endl;    //output is 12 (why confusing) 
} 

what is difference between v=v+(m++)+(++m);  and v=(m++)+(++m);  .
 
thanks


      

[Non-text portions of this message have been removed]

Reply via email to