Posted by MindBreaker at 8:59 AM
Read our previous post
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
okay you have problem to show the address of the number you enter in array.
ReplyDeletei have update the codes now it working fine,but remember that
1- Enter the number you enter in Array,and it display its address.
2- Array always start form zero so for 1st value its address is 0 and for second is 1 and so on.