One Dimensional Array Example

One Dimensional Array Example

Here you will get and learn the example code of one dimensional array example in C++ programming.

This is a simple array program, in which you will learn to declare an array, input elements in an array, and print the elements of array.

Syntax of one dimensional array

datatype array_name[array_size];

For example:

int roll_no[20]; //It can store 20 integer numbers

One Dimensional Array Example of C++

Output

Enter 10 numbers : 3
2
4
1
8

6
7
6
9
12

List of numbers are …  3 2 4 1 8 6 7 6 9 12

 

 

Check out our other C++ programming Examples

 

 

 

 

 

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top