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

Hi, I Have have completed my Post graduation in Msc(Comp Science) I want to apply for research in india or abroad How to apply? When to Apply? Even i am preparing for GRE exam. Please provide me with your valuable guidance to shape up career... Thanks :)

2069


how to prepare for exam for the post of DIPLOMA TRAINEE at HAL and also i want previous question papers.please send me.

2394


being a science how can u help a bank if we give u a job in a bank

2043


how to select a topic for project in final year?

1949


Under which situation you need to create abstract method.

1788


I have been selected for clerical interview of SBI..my interview is scheduled on 3rd may 2010...if anybody have attented before that plz tell me which type of questions they r asking..

1952


Can you send me some general information about rain forests (or climate change, pollution, food, etc.) for my information?

2178


how to prepare for upcoming group-1 exams.what is the material is best suit for preparation of group-1.

1960


what is capital,finance in accountancy??????????

1993


hi i have been salected for interview of sbi clerk plz send me some questions that often asked in interview hall

2037


please do tell me who the editor-in-chief of the Asian Age is as of 2011-12

1857


why did you leave your previous job?

1940


Which is the World’s Warmest Sea?

2392


i m from engineering background and now i want to go banks....if the question will asked that why u prefer the bank job while u r from technical background?

1933


i have tested one module at the i found one defect for it. it is fixed by developer but i want to know the impact of these defect on other module which has dependency on defect found module. Other than regression how we will use best practice for to find any impact on other module as it's near to deadline for testing

1777