in Programming in C retagged by
457 views
0 votes
0 votes
We have stored an element after a few elements in an array, where the array size is unknown, then find the position of in array.
in Programming in C retagged by
457 views

1 Answer

0 votes
0 votes
in this , we will do linear search . we will iterate our while loop till our key not found and then break our loop. and use one variable that do count++ and after when found we print the count value …

int index =0;

while(a[index]!=key){

index++;

} cout<<index;

Related questions