thanks thomas.........for advising & giving the links... bt what's the problem with the coading!!! my compilers ran easily!!
________________________________ From: Thomas Hruska <[email protected]> To: [email protected] Sent: Saturday, 5 September, 2009 10:28:32 AM Subject: Re: [c-prog] what would be the output Brett McCoy wrote: > On Thu, Sep 3, 2009 at 7:53 AM, Akash Goswami<akashgoswami93@ yahoo.com> > wrote: > >> #include<stdio. h> >> #include<conio. h> >> int main() >> { >> int m=1; >> m=m++ + m++ + ++m + ++m; >> printf("%d", m); >> getch(); >> } >> >> what would be the output &WHY?????plz explain > > *sigh* Here we go again. Code that makes you go "Huh? What does this do?" is most likely poorly written. The above is an example of that. If an employer ever shows you such code in an interview, you probably don't want to work for them. Akash: What book are you getting this from? If it is Yashavant Kanetkar's book "Let Us C", chuck the book in the trash. Maybe burn it too just to make sure no one else gets their hands on it (uh, but burn it in a safe place...). Yashavant is the worst C/C++ author ever. He single-handedly has done more damage than anyone else in the history of software development. The above code has so many problems with it, you would be smarter than your peers just by never, ever writing code like it. Since you have probably already spent money on the book, you probably can't afford much of anything, so I'll give you a link to a decent C++ author (you should be learning C++ anyway, not C): http://mindview. net/Books/ TICPP/ThinkingIn CPP2e.html You should also obtain at least a copy of a draft copy of the ANSI C/C++ Standard. Draft copies are free and c-prog links to quite a few of them here: http://tech. groups.yahoo. com/group/ c-prog/links/ Standards_ 001012496381/ -- Thomas Hruska CubicleSoft President Ph: 517-803-4197 *NEW* MyTaskFocus 1.1 Get on task. Stay on task. http://www.CubicleS oft.com/MyTaskFo cus/ See the Web's breaking stories, chosen by people like you. Check out Yahoo! Buzz. http://in.buzz.yahoo.com/ [Non-text portions of this message have been removed]
