0% found this document useful (0 votes)
23 views2 pages

Declaring and Initializing Arrays: Syntax Examples

Arrays1

Uploaded by

yatakonakiran2
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views2 pages

Declaring and Initializing Arrays: Syntax Examples

Arrays1

Uploaded by

yatakonakiran2
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Declaring and Initializing Arrays

Syntax Examples

int numbers[5]; /* Declaration */


data_type array_name[size];
int numbers[5] = {10, 20, 30, 40, 50}; /* Initialization */
Declaring and Initializing Arrays
Syntax:
data_type array_name[size];
Examples:
Declaration:
int numbers[5];
Initialization:
int numbers[5] = {10, 20, 30, 40, 50};
Partial Initialization:
int numbers[5] = {10, 20}; // Remaining elements are
initialized to 0

You might also like