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

I know the ip address of a website(for example ip address of www.yahoo.com is 69.147.125.65). How can i use this ip address to open the website instead of typing the url www.yahoo.com in the browser.

2378


can i attend the syndicate bank PO exam 2010 as my date of birth is 20th may 1980.

1917


what will be the total salary for a newly recruited taluk social welfare officer in karnataka ( Gazetted Group B Officer)

2716


What are the test cases for booking one ticket for same movie, for same time but many users.

1910


Hi friends I was selected for SBI clerical interview and my interview is on may 7 I completed B.sc Computers wat are the questions to be asked regarding computers.....can u pls post the answer for me.........JO

2011


What is F.O.R.

2392


WHAT IS MENING OF FICR

2187


Hi, I have passed the SBI SO written exam for the post Ass.Manager(Systems) . Could anyone help me with the interview type and questions? Thanks bjdas1987@gmail.com

2294


How to set tracing level for PowerCenter Informatica. Do we need to give tracing level in each and every mapping or is there any option to change tracing level commonly for all mappings. ?

2788


Out of the original and duplicate copy of form "C" received from the customer on interstate sale - which copy is to be submitted to the department ?

1521


Hi friends I am sasi,Got selected for Syndicate Bank PO.I dont have any idea about Banking sector.I dont know how to prepare for the interview.Can anyone help me plz

2103


How many pages are in 1 coil?

2007


Cosmos bank is nationalised or Not..?

4108


what is CTD format?

2270


Can someone please give me contact details of Mr Chanchal Saxena. He has previously given advice on SAP as a career

1540