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

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

1538


If i have 3 different company codes,operating in different countries with different currencies so what will be my controlling area currency is it different for all company codes or only one. how will i get consolidated report.

2103


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 ?

1512


Hi I am looking for Hadoop Cloudera certification dumps. Please contact me if you some one have any idea about it. nzkhum786@gmail.com

1813


can any one pls instuct me , to trace my hall ticket number from online , for the TNPSC exam which was held on feb 2009

2242


WHAT WILL BE THE ENTRY FOR RECEIVING THE GOODS OF FREE SAMPLES IN THE BOOKS OF RECEIVER???

2246


We (a Private Organisation)have purchased furniture worth Rs.1.4 lacs from a firm Whhile making payment should we deduct TDS@2% ?

1919


i completed my btech in 5years..can i get job on java..do recruiters prefer me if i get a good command on java

1927


Do you have a girlfriend? If not, why?

2371


generally asked question in bpo backoffice

2715


what are the things to be looked after for marketing,purchase and sale?

1867


What has been your biggest disappointment

2021


hi, i perparing for JBT FROM JAMMU ,PLZ SOMBODY HELP ME IN MY STUDY, IF SOME ONE HAS PREVIOUS PAPER OF JBT PLZ SEND ME, CONTACT MY EMAIL ID anilkumaryadav2310@gmail.com

2092


Hi i have a problem.I have been completing my graduation & p.g from correspondence universities.Now for sbi interview i want character certificate from this universities.but these universit. do not issue characeter certificate.But in sbi it is required.Now what can i do?Please help me.My interview is on 29th april.

1870


how to select a topic for project in final year?

1930