Data Declarations

Data declarations are of the form:

   type name [ = value];
type is a data type (e.g.
float)
name is the name you give it (e.g.
Payrate)
value is an optional initial value for the variable

Examples:

char one_letter;
char first_letter = 'a';
int hours = 24;
float Payrate = 10.5;
int a, b, c;
int a = 1, b, c = 5;
Previous page
Next page

Back to Lesson 2 Index
Back to Outline