Array Sheet
Array Sheet
Answer
#include <iostream>
using namespace std;
#include <cstdlib>
int main()
{
int arr[] = {1, 2, 3, 4, 5, 6};
int length = sizeof(arr) / sizeof(int);
Or
#include <iostream>
using namespace std;
#include <cstdlib>
int main()
{
int length;
int* arr;
cout << "plz enter the length of the array: ";
cin >> length;
arr = new int[length];
for (int i = 0; i < length; i++)
{
cout << "plz enter in the array the element No " << i << ": ";
cin >> arr[i];
}