WORLD OF COMPUTERS
Would you like to react to this message? Create an account in a few clicks or log in to continue.

WORLD OF COMPUTERS


 
HomeLatest imagesSearchRegisterLog in

 

 Chapter 1.3: Explaining Variables

Go down 
AuthorMessage
Crash




Posts : 15
Join date : 2010-08-21

Chapter 1.3: Explaining Variables Empty
PostSubject: Chapter 1.3: Explaining Variables   Chapter 1.3: Explaining Variables Icon_minitimeSat Aug 21, 2010 4:53 am

Declaring the variables. You can set any name to a variable.
Quote :
int x, y, result;

The variable x holds the number 4.
Quote :
x = 4;

The variable y holds the number 7 and counts the value of the variable x itself.
Quote :
y = 7 + x;

The variable z is the variable y and it basically means that value of the variable z is 7 + x.
Quote :
z = y;

Inputs the value of the variable z
Quote :
cout << "Result is " << z;

Inputs a new line.
Quote :
cout << "\n";
Back to top Go down
 
Chapter 1.3: Explaining Variables
Back to top 
Page 1 of 1
 Similar topics
-
» Chapter 1.2: Using Variables
» Chapter 1.1: Explaining Your First Program
» Chapter 1.5: Explaining Strings
» Chapter 1.7: Explaining Constants
» variables or strings?

Permissions in this forum:You cannot reply to topics in this forum
WORLD OF COMPUTERS :: Computer Programming :: C++-
Jump to: