Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Computer Forums > Programmers Lounge > Programming Discussions » A "C" programming question
Closed Thread
Old 10-20-2004, 08:46 PM   #1 (permalink)
 
Newb Techie

Join Date: Oct 2004

Posts: 14

LauraP

Default A "C" programming question

If you have a C program where no matter if you calculate the output from left to right or right to left it calcuates the same output, but when you calculate the output from left to right and right to left with paper and pencil and you get a different output. Why is that?
LauraP is offline  
Old 10-23-2004, 10:44 AM   #2 (permalink)
 
Ultra Techie

Join Date: Sep 2003

Location: Bamberg, Germany

Posts: 549

Iron_Cross

Send a message via ICQ to Iron_Cross Send a message via MSN to Iron_Cross Send a message via Yahoo to Iron_Cross
Default

That was more confusing than I'd ever seen. Please show us some code or explain a little more.
__________________

See today\'s Penny-Arcade!(May contain foul lanuage)
Pain is weakness leaving the body.

PM Me for my MSN
Iron_Cross is offline  
Old 10-23-2004, 04:18 PM   #3 (permalink)
 
Super Techie

Join Date: Jun 2004

Posts: 312

sippin codeine

Send a message via Yahoo to sippin codeine
Default

LOL, calculate what output? like cross said elaborate a little more.
__________________
**[System specs]**

Delphi Enterprise 6 - 7
VB 6.0 - 2005 EE
sippin codeine is offline  
Old 10-24-2004, 11:41 PM   #4 (permalink)
 
True Techie

Join Date: Sep 2003

Posts: 161

Cherubimon_3.20

Default

I think what he's trying to say is that the computer will calculate the output in order of BEDMAS: Brackets, Exponents. Division, Multiplication, Addition, Subtraction.
Cherubimon_3.20 is offline  
Old 10-25-2004, 12:04 AM   #5 (permalink)
 
Super Techie

Join Date: Jun 2004

Posts: 348

sithspawn

Default

i thought it was BIMDAS

Brackets, Indices, Mult, Div, Add, Sub

of course its exactly the same except mult and div.
sithspawn is offline  
Old 10-25-2004, 10:02 PM   #6 (permalink)
 
Ultra Techie

Join Date: Sep 2003

Location: Bamberg, Germany

Posts: 549

Iron_Cross

Send a message via ICQ to Iron_Cross Send a message via MSN to Iron_Cross Send a message via Yahoo to Iron_Cross
Default

PEMDAS
Parenthesis, Exponents, Multi, Div, Add, Sub
__________________

See today\'s Penny-Arcade!(May contain foul lanuage)
Pain is weakness leaving the body.

PM Me for my MSN
Iron_Cross is offline  
Old 10-26-2004, 12:09 AM   #7 (permalink)
 
True Techie

Join Date: Sep 2003

Posts: 161

Cherubimon_3.20

Default

Thats what I said except you call it Parenthesis instead of Brackets.
Cherubimon_3.20 is offline  
 
Closed Thread

Thread Tools
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