Saturday, January 17, 2009

LEARNINGS OF THE WEEK (Jan. 12-16)
By: Frea Diane T. Bautista
Last week, we tackled about arrays. We, Batch 1, have an activity about our last topic which is "ARRAYS".
ARRAY -it is a collection of variables of the same data type that is referenced by a common name.
Array declaration The general form for any declaration is as follows: type array_name[size]; Where: type is any valid data type in Turbo C which declares the type of values that array will hold. array_name is a valid variable name which will name the array. size defines how many elements the array will hold. Array Initialization Arrays can give initial values during the declaration. This is called array initialization. int Array1[5]={25,5,7,11,163}



Array[0] = 25
Parts of the Array:
Where:
Array – array name
[0] – subscript or index
25 – array element
ARRAY DECLARATION
This is the general form for any declaration:



type array_name[size];

Where:
type is any valid data type in Turbo C which declares the type of values that array will hold.
array_name is a valid variable name which will name the array.
size defines how many elements the array will hold.



int number[100] , answer [25];

No comments: