Posted by MindBreaker at 8:59 AM
Object
Using
array find element in index of array taken input from user.
Source code
using namespace std;
void main()
{
int enter;
int find[12];
cout << "Enter Numbers to save in array" << endl;
for(int enter_loop = 0; enter_loop < 12; enter_loop ++)
{
cin >> find[enter_loop];
}
cout << "Enter a Number you want to see the address of number in array\n";
cin >> enter;
int loop;
for(loop = 0; loop <= enter; loop++)
{
if(find[loop] == enter)
{
cout << "The Address is: " << loop;
break;
}
}
}
Output