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

who is the cricter to score century in odi is the don bradman or other then this

1931


iwant to join testing in mind q.is there any new batch will start for testing? i heard that nageswarao is not in mindq he started another institute which one is better? i also want to know the fee deails & duration of the course.

2915


What is Micro-kernel? What are the benefits of Micro-kernel?

1874


ph is 4.01,6.86,9.18 mv value 184.7,19.0,-110.7 how to calculate slope manually

942


can any one help me ,i'm appearing syndicate bank clerical exam on 27-6-10

1942


i had an backlog in my engg finial year.so i am counted as 2008 or 2009 passout for applying to IT companies? so what should i keep it in my resume thanks in advance.

1851


what is the shortkey of print preview in M.S. EXCEL?

2002


why you want to leave your existing company & join our company?

2366


What types of challenges have you faced in the past two years and how did you overcome them?

1781


Hi, i have been selected for abhyudaya clerk interview but dont have the application print out. Will i be allowed for interview?

2199


what are points to be kept in mind while purchasing consumers for CSD?

1865


international  resume format

2118


do any one faced sbi interview. If yes please share ur experience

2020


I m doing a job in a psu as distribution engineer. Now I m looking for a job in an electrical manufacturing company where I can boost up my professional knowledge.i dont have such experience for getting such a job . Pls suggest me how to shift from distribution to manufacturing.

1800


Sir me s.I ke bare me janna chahta hoo.s.I banne ke liye kya kya common chahiye .mene is sal isc diya.

1861