| | |
application of stacks.
Please support our Computer Science advertiser: Learn about neural networks and artificial intelligence.
Thread Solved |
i have this question..
show the state of the stack and the value of each variable after execution of the following statements.
let A=5, B=3, C=7
push A onto stack
push C*C onto stack
pop item fron the stack and store in B
push B+A onto stack
pop item from the stack and store in A
pop item for the stacj and sotore in B
-------------------------------------
what will be the value of B after C*C is popped out of the stack?? will the predefined value of B be overwritten?? and what if B is pushed onto the stack, will the value of the pushed B be the value of the result of C*C??
for example..
this???
push A onto stack = 5
push C*C onto stack = 49
pop item fron the stack and store in B = B=49
push B+A onto stack = 49+5=54
pop item from the stack and store in A = A=54
pop item for the stacj and sotore in B = B=5
??????????????????????
or this??
push A onto stack = 5
push C*C onto stack = 7*7=49
pop item fron the stack and store in B = B=49
push B+A onto stack = 3+5=8
pop item from the stack and store in A = A=8
pop item for the stacj and sotore in B = B=5
???????????????????/
HELP
show the state of the stack and the value of each variable after execution of the following statements.
let A=5, B=3, C=7
push A onto stack
push C*C onto stack
pop item fron the stack and store in B
push B+A onto stack
pop item from the stack and store in A
pop item for the stacj and sotore in B
-------------------------------------
what will be the value of B after C*C is popped out of the stack?? will the predefined value of B be overwritten?? and what if B is pushed onto the stack, will the value of the pushed B be the value of the result of C*C??
for example..
this???
push A onto stack = 5
push C*C onto stack = 49
pop item fron the stack and store in B = B=49
push B+A onto stack = 49+5=54
pop item from the stack and store in A = A=54
pop item for the stacj and sotore in B = B=5
??????????????????????
or this??
push A onto stack = 5
push C*C onto stack = 7*7=49
pop item fron the stack and store in B = B=49
push B+A onto stack = 3+5=8
pop item from the stack and store in A = A=8
pop item for the stacj and sotore in B = B=5
???????????????????/
HELP
•
•
Join Date: Feb 2009
Posts: 3
Reputation:
Solved Threads: 1
They want you to show the state of the stack, ie what's in it.
So more like
push A onto stack [5]
push C*C onto stack [49,5]
...
So more like
push A onto stack [5]
push C*C onto stack [49,5]
...
•
•
Join Date: Sep 2009
Posts: 4
Reputation:
Solved Threads: 0
•
•
•
•
i have this question..
show the state of the stack and the value of each variable after execution of the following statements.
let A=5, B=3, C=7
push A onto stack
push C*C onto stack
pop item fron the stack and store in B
push B+A onto stack
pop item from the stack and store in A
pop item for the stacj and sotore in B
-------------------------------------
what will be the value of B after C*C is popped out of the stack?? will the predefined value of B be overwritten?? and what if B is pushed onto the stack, will the value of the pushed B be the value of the result of C*C??
for example..
this???
push A onto stack = 5
push C*C onto stack = 49
pop item fron the stack and store in B = B=49
push B+A onto stack = 49+5=54
pop item from the stack and store in A = A=54
pop item for the stack and store in B = B=5
??????????????????????
or this??
push A onto stack = 5
push C*C onto stack = 7*7=49
pop item fron the stack and store in B = B=49
push B+A onto stack = 3+5=8
pop item from the stack and store in A = A=8
pop item for the stacj and sotore in B = B=5
???????????????????/
HELP
your first example
ie
push A onto stack = 5
push C*C onto stack = 49
pop item fron the stack and store in B = B=49
push B+A onto stack = 49+5=54
pop item from the stack and store in A = A=54
pop item for the stack and store in B = B=5
is definetly right..ok
![]() |
Similar Threads
- how to run 32 bit application on 64 bit os (Windows NT / 2000 / XP)
- Frozen forms on another thread (C#)
- Data Structure help (stacks) (Java)
- C++ and data access (C++)
- Dell Latitude D620 , stacks with initial booting process (Motherboards, CPUs and RAM)
- Is assembly worth learning it? (Assembly)
- binary integer logic (Computer Science)
- Given two queues, can we implement a stack (C)
- question on Stacks push,pop. (C++)
- Pointers (C++)
Other Threads in the Computer Science Forum
- Previous Thread: UK looks for bite of 110 million CERN contract cherry
- Next Thread: File Structure , PLease help thanks.
| Thread Tools | Search this Thread |
ai algorithm algorithms amazon assignment assignmenthelp assignments battery bigbrother binary bittorrent bizarre bletchleypark blogging bomb business codebreaker compiler computer computers computerscience computertrackingsoftware connect conversion csc data dataanalysis dataintepretation development dfa dissertation dissertations dissertationthesis dissertationtopic ebook employment energy extensions floatingpoint foreclosure foreclosuresoftware fuel gadgets geeks givemetehcodez government graphics hardware history homeowners homeworkassignment homeworkhelp humor ibm idea ideas internet ipod itcontracts jobs kindle laser laws linkbait lsmeans mainframes marketing mobileapplication msaccess nano networking news os p2p piracy piratebay principles programming rasterizer sam-being-cute sas science security sex simulation software spying sql stephenfry study supercomputer supercomputing sweden technology textfield turingtest two'scompliment uk virus ww2






