Forum     

Go Back   Digit Technology Discussion Forum > Portables, Peripherals and Electronics > QnA (read only)
Register FAQ Calendar Mark Forums Read

QnA (read only) Mods please help transfer the contents of this forum to proper sections. :)


 
 
LinkBack Thread Tools Search this Thread Display Modes
Old 12-08-2007, 09:46 PM   #1 (permalink)
Hey here is the aks
 
arunks's Avatar
 
Join Date: Jan 2006
Location: punjab
Posts: 805
Default pLZ hELP ME FAST ..ITS EMERGENCY


pEOPLE who know C or c++ plz help me


int a=10,s;

s= ++a + a++ + --a + a--;


what would be the poutput for s??


according to me it should be 44 but when i run this code in C it displays 40...

why is it so... plz anybdy help me to understand that?

but if i use this

int a=10,s;
printf("%d",++a + a++ + --a + a--);

this code displays 44 as expected by me..

But according to me no difference should be there in above two codes..

Plz reply fast as i need this answer urgently
__________________
yours truly
arun
The aks!!

have a nice day
arunks is offline  
Advertisements. Register and be a member of the community to get rid of them.
Advertisement

Old 13-08-2007, 12:18 AM   #2 (permalink)
Rebooting
 
Choto Cheeta's Avatar
 
Join Date: Aug 2004
Location: 220.225.82.33
Posts: 6,266
Default Re: pLZ hELP ME FAST ..ITS EMERGENCY

Double Post... help me urgently to understand this in C
__________________
rebooting
ChotoCheeta.com
Choto Cheeta is offline  
Old 13-08-2007, 12:52 AM   #3 (permalink)
18 Till I Die............
 
Join Date: Jul 2004
Location: India, Mumbai, Marine Lines
Posts: 5,792
Default Re: pLZ hELP ME FAST ..ITS EMERGENCY

If I am right. It's evaluated from right to left, not left to right. That's why.
mehulved is offline  
Old 13-08-2007, 08:29 AM   #4 (permalink)
Right Off the Assembly Line
 
Join Date: Aug 2007
Posts: 6
Default Re: pLZ hELP ME FAST ..ITS EMERGENCY

yes dear evaluvation is always frm right to left so its happenin like this way
e17ad is offline  
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
hey! i have n70 ........so help me here fast!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! arunks Mobiles and Tablets 2 29-01-2007 10:03 PM
Windows Vista Customer Preview Program—RC1 is open now..fast fast ravi_9793 Technology News 19 20-09-2006 11:54 AM
help!!!!!!!!!!!!!!! its an ****ing emergency ramanmittal Software Q&A 4 09-11-2005 10:18 PM
Web Host---Emergency!!! saptak Internet & WWW 5 10-09-2005 07:03 AM
Installing IIS 5 <EMERGENCY> saptak QnA (read only) 7 22-08-2005 11:40 AM

 
Latest Threads
- by Tenida
- by Charan
- by abhidev

Advertisement




All times are GMT +5.5. The time now is 10:22 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.

Search Engine Optimization by vBSEO 3.3.2