Write a program that initialize 10 values in arrays. Your program asks a number from user and prints only last location of entered number.
#include <iostream>
using namespace std;
int main() {
int array[10];
int i;
cout<< “Please enter the array elements”<<endl;
for (i=0 ; i<10; i++) {
cin >> array[i];
}
cout << “ /n The last elements of the arry is “ << array[9]<<endl;
return 0;
}
Comments
Leave a comment