LEARNINGS OF THE WEEK
By: Cielito M. Cantero
IV - Rizal
The students were very busy this week. Because this week was the time for us to take our third periodical examination.
We took the T.L.E examination January 16.
It was really really HARD...
I
I still get confused every time I trace the program...
I spend lot of the time in analyzing the program...
For me, programming is one of hardest lesson I've ever took...
And also, we have some reviews about our past lessons before the day of the test come.
We also discussed about array this week. To understand more about array, read below.
Array is a collection of variables of the same data type that is referenced by a common name.
Consider the illustration below…
#include main()
{
int array[4]={25,5,7,11,163};
clrscr();
printf(“%d %d %d %d %d”, array[0], array[1], array[2],array[3],array[4]);
getch();
}
Output:
25 5 7 11 163
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.
The two declarations for arrays number and answer can be combined into a single declaration:
int number[100] , answer [25];
array initialization
Arrays can give initial values during the declaration. This is called array initialization..
int Array1[5]={25, 5, 7, 11, 163};
-------------------------------------------------------------------------------------------------
huhuhu..
la jud koy nasabtan miskan unsaon...
how sad... :-(
By: Cielito M. Cantero
IV - Rizal
The students were very busy this week. Because this week was the time for us to take our third periodical examination.
We took the T.L.E examination January 16.
It was really really HARD...
I
I still get confused every time I trace the program...
I spend lot of the time in analyzing the program...
For me, programming is one of hardest lesson I've ever took...
And also, we have some reviews about our past lessons before the day of the test come.
We also discussed about array this week. To understand more about array, read below.
Array is a collection of variables of the same data type that is referenced by a common name.
Consider the illustration below…
#include
{
int array[4]={25,5,7,11,163};
clrscr();
printf(“%d %d %d %d %d”, array[0], array[1], array[2],array[3],array[4]);
getch();
}
Output:
25 5 7 11 163
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.
The two declarations for arrays number and answer can be combined into a single declaration:
int number[100] , answer [25];
array initialization
Arrays can give initial values during the declaration. This is called array initialization..
int Array1[5]={25, 5, 7, 11, 163};
-------------------------------------------------------------------------------------------------
huhuhu..
la jud koy nasabtan miskan unsaon...
how sad... :-(

No comments:
Post a Comment