Using Variables
Open up your add.ex file. Change the program to look like the following:
integer x, y
x = 23489
y = 1293374
?x+y
Save the file and run it.
eui add.ex
1316863
You'll notice that we got the same output as before! You're seeing already how there are different ways to accomplish the same programming task. Generally, it's a matter of personal taste how one goes about accomplishing a particular programming task. For this particular task, however, our first program required a lot less typing, so it was a bit more efficient. The use of variables for a program that adds two numbers is overkill. When we have a program that will add two numbers together that we cannot determine in advance, we will have to use variables.