USING C Load 10 integers into an array then prompt the user
USING C++
Load 10 integers into an array, then prompt the user for a number from 0 to 9. Display the element at the array position the user selects. For example:
It should output exactly like this:
Solution
#include<iostream>
 using namespace std;
 int main()
 {
int a[10],num,i;
cout<<\"Enter the array elements\";
 //entering the array elements
 for(i=0;i<10;i++)
 {
 cin>>a[i];
 }
//entering the number between 0 to 9
 cout<<\"Enter a number from 0 to 9\";
 cin>>num;
 //displaying the number at the position specified by user
 cout<<\"Element number \"<<num<<\" is \"<<a[num];
 return 0;
 }

