Jump to content


  • Content count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About smartsathiya

  • Rank
  • Birthday 08/27/1987

Profile Information

  • Gender
  • Location
  1. smartsathiya

    c aptitude plz explain

    The answer is 57 94I explain you clearly don't be worried...First know that x++ will increment the value by one but the value didn't stored in x...and at the same time ++x increments the value of x and stores the new x's value in x...so inint x=20,y=35;x=y++ + x++; here we get y++=35++=36 but still y=35 only not 36 because it is y++, but this 36 value is kept in memory until the compiler moves to next line but still y=35 only...But due to keeping 36 in memory that value is taken and added with x++,since we know x++=20++=21,this value also kept in memory and still x=20 onlynow x=36+21 gives x=57 but still y=35 onlybuty=++y=++35 gives y=36 now only and then ++x=++57 gives x=58so now y=36+58=94now the result isx=57y=94I think so this explanation will be useful to u friends ----Regards S.Sathiyamoorthy.