
-----------------------------------
-JP-
Sun Mar 06, 2005 4:20 pm

Variables/Values Help
-----------------------------------
Well, I just started Turing and searched for any topics related to my problem, but no luck found.

There are a couple of problems I need of help.

1) Switching values contained in variables.
If I start with this:
var x: int
var y: int
x:= 7
y:= 4
x:= y
y:= x

The result would be 4 for each variables, while y, after switching the values, is suppose to be 7. I need on how to solve this problem and getting the results for each variables (after switching the values) correctly.

2) Writing a program that asks the user for a three-digit number, find the sum of the digits of the number.

I can get up to the part where asking the user to input in a three-digit number, but I don't know how to get the sum of the digits of the number by coding. I have no experience on splitting the digit numbers as a variable, sorry >