Simple C++ Program for Find Array Size
Definition
An array is a collection of data that holds homogeneous values. That means values should be in same type
Array Syntax
type variable_name[size]
Sizeof Syntax
sizeof(data_type)
Simple C++ Program for Find Array Size
/*## Simple C++ Program for Find Array Size */
/*## Simple Array Programs In C++,Find Array Size C++ Programming,sizeof Example*/
// Header Files
#include <iostream>
#include<conio.h>
using namespace std;
int main() {
// Declare Array Variable
int array[5]= { 1, 2, 3, 4, 5 };
//Read Day Value
int size;
cout<<"Simple C++ Example Program for Simple C++ Program for Find Array Size\n";
size = sizeof(array)/sizeof(int);
//Print size of Array
cout<<"The Size of Array is "<<size;
getch();
return 0;
}
Sample Output
The Size of Array is 5
C++ Array Example Programs
- Single Dimensional Array Example Program in C++ Programming
- Sum of Array C++ Example Program
- Read Array and Print Array C++ Example Program
- Find Largest or Biggest Number In Array C++ Example Program
- Simple Sorting In Array C++ Example Program
- Simple Sorting Descending Order In Array C++ Example Program
- Simple Searching In Array C++ Example Program
- Simple C++ Program for Find Array Size
- Matrix Addition 2 D (dimensional) Array Example Example Program
- Matrix Subtraction 2 D (dimensional) Array Example Example Program
- Matrix Multiplication 2 D (dimensional) Array Example Example Program
Read More Articles
- Simple Merge Sort Program in C++
- Scope Resolution Operator In C++
- Simple Program for Virtual Functions Using C++ Programming
- Simple Class Example Program For Find Prime Number In C++
- Simple Example Program For Parameterized Constructor In C++
- Define Constructor in Outside Class Example Program In C++
- Simple Example Program For Copy Constructor In C++
- Simple Program for Function Overloading Using C++ Programming
- Simple Program for Single Inheritance Using C++ Programming
- Simple Program for Inline Function without Class Using C++ Programming
- Simple Example Program For Constructor In C++
- Factorial Using Function Example Program In C++
- Simple Addition ( Add Two Integers ) Example Program
- Simple Example Program for Inline Function Using C++ Programming
- Simple Program for Read user Input Using cin
- Simple Example Program For Constructor Overloading In C++
- Factorial Using Loop Example Program In C++
- Simple Stack Program in C++ Programming
- Simple Program for Friend Function Using C++ Programming
- Simple Program for Static Data and Member Function Using C++ Programming
- Simple Program for Unary Operator Overloading Using C++ Programming
- Do While Loop Example Program In C++
- Simple Program for Binary Operator Overloading Using C++ Programming
- Simple Program for Multiple Inheritance Using C++ Programming
- Simple Copy Constructor Example Program For Find Factorial In C++