An ARRAY is a accumulating of similar elements. These agnate elements could be all ints, or all floats, or all chars, etc. Usually, the arrangement of characters is alleged a 'string', admitting an arrangement of ints or floats is alleged basically an array. Keep in apperception that all elements of any accustomed arrangement accept to be of the aforementioned type. i.e. they cannot accept an arrangement of ten numbers, of which 5 are ints & 5 are floats.For example, we want to align the allotment marks acquired by 100 acceptance in ascendance order. In such a case they accept options to abundance these marks in memory:
Obviously, the additional another is better.This is wahat we call array.
ARRAY INITIALISATION:
Arrays can be initialised as followed:
int a[6] = { 2, 4, 12, 5, 45, 5 } ;
int b[ ] = { 2, 4, 12, 5, 45, 5 } ;
float c[ ] = { 12.3, 34.2 -23.4, -11.3 } ;
- Construct 100 variables to abundance allotment marks acquired by 100 altered students, i.e. anniversary capricious absolute student's marks.
- Construct capricious (called arrangement or array) able to autumn or captivation all the hundred values.
Obviously, the additional another is better.This is wahat we call array.
ARRAY INITIALISATION:
Arrays can be initialised as followed:
int a[6] = { 2, 4, 12, 5, 45, 5 } ;
int b[ ] = { 2, 4, 12, 5, 45, 5 } ;
float c[ ] = { 12.3, 34.2 -23.4, -11.3 } ;
Sunday
//
Labels:
C LANGUAGE
//
0
comments
//
0 comments to "ARRAYS IN C LANGUAGE"
Powered by Blogger.
Blog Archive
-
▼
2011
(50)
-
▼
July
(38)
- INTRODUCTION TO C
- DATA SETS IN C
- DATA TYPES
- VARIABLES
- SIMPLE C PROGRAM
- PROGRAM USING SCANF() AND PRINTF()
- C INSTRUCTIONS
- INTRODUCTION TO DECISION CONTROL STRUCTURES
- IF STATEMENT
- IF STATEMENT PROGRAM
- IF ELSE STATEMENT
- NESTED IF ELSE
- DETERMINING ROOTS OF AN EQUATION
- ELSE IF STATEMENT
- LOGICAL AND ARITHMETIC OPERATORS
- CONDITIONAL OPERATORS
- LOOPS
- THE WHILE LOOP
- The for bend specify things about a bend in a ind...
- EXAMPLE OF FOR LOOP
- NESTING OF LOOPS
- THE ODD LOOP
- THE DO-WHILE LOOP
- BREAK STATEMENT IN C
- THE CONTINUE STATEMENT IN C
- SWITCH STATEMENT IN C
- SIMPLE PROGRAM SHOWING SWITCH STATEMENT
- THE GOTO STATEMENT IN C LANGUAGE
- FUNCTIONS IN C LANGUAGE
- CALLING FUNCTIONS IN C LANGUAGE
- CALL BY REFERENCE IN C LANGUAGE
- POINTERS IN C LANGUAGE
- SIMPLE PROGRAM SHOWING POINTER IN C LANGUAGE
- PROGRAM FOR FUNCTION CALL BY REFERENCE IN C
- SWAPPING OF TWO NUMBERS IN C
- RECURSION IN C LANGUAGE
- FACTORIAL OF A NUMBER WITHOUT RECURSION IN C
- ARRAYS IN C LANGUAGE
-
▼
July
(38)
Post a Comment