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

when ct ratio 50/5, 100/5,400/5 and 800/5 va:15,class:1 ilv:3 kv/-50hz sf<5 how to calculate kwh

2476


My PC auto restart some times goes shutdown..is PSU 12V is responsible for it becoz its not ok as seen bios Hardware

1497


I am a b.tech(IT) graduate.What are the b.tech subject topics i have to prepare for sbi clerk interview as i was told that q's will be there in our specialised subjects

1901


Hi i have been selected in federal bank Po exam can somebody throw some light on what type of interview questions are expected??

2044


The primary purpose of an operating system is....

2226


I have a question, I'd like to know what does "roc" means? E.g. in Beyonce's song : Roc. She is singing: You are my roc, I love to roc with you and it's not a rock. Help me...

1900


Dear All, If employee completed his/her probation period for 6 month and still continued, we can terminated him because he was misbehave with Director of the company or employee registered the complaint in labor court for compensation? Shazia Muzaffar

2332


i am B.E Civil engineer 2 year exp in construction i want to job in singapore so pls tell me any best and trust oversea consultancy in chennai plzs help me

1732


did anyone attended java 2+ exp interview in dec-2010?

1800


i got job from icici bank as an PO and as a clerk in canara bank. which one is best to choose..

2236


name the sikkim state bird?

3784


what is the main difference between direct & indirect marketing?

1973


which type of growth do you want?

1855


what is hi... meaning

1791


Sir I m doing US based CFA. and I m MBA Finance from Gujarat University. I have 3 years of accounting cum Audit experience in India and Dubai. How this can help me to have US Visa. Means what is more required to apply for the employment Visa. Please reply me. Means which type of Employment Visa can I have good support.. Please reply me. What is still needed for my eligibility. for the same.

1853