Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

U have an array of +ve integers arranged in the descending
order . Write a functionb thast take an integer & an integer
array as an integer and returns the position of the given
integer in the array , if the integer is not present in the
array it should return -1 . the serching technique that u
use should be very efficient both in terms of time & memory.

Answer Posted / sonu

int array[]={13,232,234,12,34,56,73,21,230,240};
int max ;
max = 230;
for (int i=1;i<array.length;i++){
if (array[i]==max ){
System.out.println
("Position of no"+max +"in array is "+i);
}else {
System.out.println("-1");
}
}

Is This Answer Correct ?    2 Yes 12 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

how to eject cd/dvd through command?????

1832


How The Resume Will Be....?

1877


hii,anybody got joining letter in dfo(gd) 2013.PLZZ mail me at rahuldikshit7@gmail.com

1860


I am having the inbuilt Webcam in my Laptop, I want to sent the pictures using webcam to others. Please tell me the steps?

1752


How we use ABC analysis at store for inventory control

2263


Mahatma Budhy got enlightment under the Banyan tree (Bat briksha) then why there are peepal tree in Bodh Gaya

2503


Is there any institution for giving graduate degree in one year?

1775


HELLO FRIENDS,I AM ABHAY KUMAR IM HISTORY HON AND I HAVE QUALIFIED IBPS PO EXAM .CAN U SUGGEST ME WHAT KIND OF QUESTION CAN ASK IN INTERVIEW ??

2171


breif about your sefl?

1795


HI,Please Give me the suggestion to join in Sristek,Hyderabad to work on SAS?Please tell me how is this company? and how the career in this company????

2161


what is insurance what is insurance?

2068


as i have two rejections on my passport is this affect my approval for visa and whether they will ask me any questions related to past interview done plz inform me soon as my interview is on 20 july

1935


sir/madam, i would like to know the work for fresh engineering electrical graduates in psu,ies etc.,

1815


what are the environmental problems associated with the match industry?

2155


my parents resides in us and i have no reason to say why i will come back plz tell me what answer i will give as my interview is on 20 july

1852