Welcome to Dream.In.Code
Become a C++ Expert!

Join 137,206 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 2,362 people online right now. Registration is fast and FREE... Join Now!




Values of variables

 
Reply to this topicStart new topic

Values of variables

szostek89
31 May, 2008 - 08:02 PM
Post #1

New D.I.C Head
*

Joined: 29 May, 2008
Posts: 3

My question is what does the perform change do in this code and do I need to run this through some program in order to solve?



start
a = 2
b = 4
c = 10
while c > 6
perform changeBAndC ()
endwhile
if a = 2 then
perform changeAAndB ()
endif
if c = 10 then
perform changeAAndB ()
else
perform changeBAndC ()
endif
print a, b, c
stop

changeBAndC ()
b = b + 1
c = c - 1
return

changeAAndB ()
a = a + 1
b = b - 1
return

User is offlineProfile CardPM
+Quote Post

no2pencil
RE: Values Of Variables
31 May, 2008 - 08:07 PM
Post #2

My fridge be runnin OH NOEZ!
Group Icon

Joined: 10 May, 2007
Posts: 6,504



Thanked: 67 times
Dream Kudos: 2425
Expert In: Goofing Off

My Contributions
It's not going to do anything, as you didn't pass any values into it. So the when it changes A & B, it's only going to change it to the local variables. You would need to pass them back, or declare them as global variables.

Since you've only posted a narrative as to what the code is doing, I can only take a guess. If you can provide us with much more detailed code, then we can get a better idea to answer your question.
User is offlineProfile CardPM
+Quote Post

szostek89
RE: Values Of Variables
31 May, 2008 - 08:42 PM
Post #3

New D.I.C Head
*

Joined: 29 May, 2008
Posts: 3

This is all the code I got I was just wondering what the perform change means and my other question is what program I can use to try to enter in code and it will tell me any errors I may have.
QUOTE(no2pencil @ 31 May, 2008 - 09:07 PM) *

It's not going to do anything, as you didn't pass any values into it. So the when it changes A & B, it's only going to change it to the local variables. You would need to pass them back, or declare them as global variables.

Since you've only posted a narrative as to what the code is doing, I can only take a guess. If you can provide us with much more detailed code, then we can get a better idea to answer your question.


User is offlineProfile CardPM
+Quote Post

no2pencil
RE: Values Of Variables
31 May, 2008 - 08:48 PM
Post #4

My fridge be runnin OH NOEZ!
Group Icon

Joined: 10 May, 2007
Posts: 6,504



Thanked: 67 times
Dream Kudos: 2425
Expert In: Goofing Off

My Contributions
QUOTE(szostek89 @ 1 Jun, 2008 - 12:42 AM) *

This is all the code I got

Well, that isn't correct C/C++ code by any stretch of the imagination.

QUOTE

...and my other question is what program I can use to try to enter in code and it will tell me any errors I may have.

[url=http://www.dreamincode.net/forums/showtopic20933.htmCheck here[/url] for a list of free compilers.
User is offlineProfile CardPM
+Quote Post

Reply to this topicStart new topic
Time is now: 12/4/08 12:37PM

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month