Answer to Question #155927 in C++ for Talha

Question #155927

Write a program that initialize 10 values in arrays. Your program asks a number from user and prints only last location of entered number. 


1
Expert's answer
2021-01-16T11:52:07-0500
#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;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS