C One Dimensional Array

Array

Array is type of variable which contains one or more than one values in c language. In c language array contains same type values.

There are three types of array: (1.) 1-D Array (2.) 2-D Array (3.) Multidimensional Array

Array

1-D Array

It is type of array. Index always start from zero(0). First value always assign into zero(0) index. A single index of array contains only one value.

Syntax

data-type arrayName[ ] = {value1, value2, value3,.................};

See Output

If array data-type is int then array will contain only int type values.


See Output

Syntax

data-type arrayName[size] = {value1, value2, value3,.................};

See Output

Syntax

data-type arrayName[size];

See Output

In below program, you can use 1-D array dynamically.

In below program, you can read values from user into 1-D array.

See Output

About Us

Comsysapp.com is an educational website. Students and software developers can learn programming language tutorials. Comsysapp is very useful for beginners and professional developers. Comsysapp provides tutorial in easy language. Comsysapp.com has focus on simplicity.

Services

Comsysapp.com provides free tutorials like c, html, css, etc. All tutorials are free for beginner and professionals.


Terms of Use

comsysapp.com is not responsible for any mistake. We are not responsible if information made available on our website is incomplete or invalid. But comsysapp.com always try for zero-zero mistake.

Privacy policy

comsysapp.com does not collect any data from users. We use Google AdSense advertising on our website. We never ask personal or private information.


Sitemap

sitemap

copyright © 2023