how i can print the elements before a spicific value in array queue?

how i can print the elements before a spicific value in array queue?

how i can printall elements befor the spicific value and print this value also

View Answers

January 8, 2011 at 4:05 PM

Hi Friend,

Try this:

<html>
<script>
var arr=new Array();
arr[0]=10;       
arr[1]=20;
arr[2]=30;
arr[3]=40;       
arr[4]=50;
arr[5]=60;
arr[6]=70;       
arr[7]=80;
arr[8]=90;
arr[9]=100;
var i;
var num=window.prompt("Enter array element: ");
document.writeln("The value is: "+num+"<br>");
for(i=0;i<arr.length;i++){
if(arr[i]<num){
document.writeln(arr[i]+"<br>");
}
}
</script>
</html>

Thanks









Related Tutorials/Questions & Answers:
how i can print the elements before a spicific value in array queue?
If Sessin Contain Array how can i get each value.
Advertisements
how to sort the elements of hashmap and to print output the key and the value attached to it
How can we know the count/number of elements of an array?
how can i print the selected content of a frame
How to Print Array in JavaScript
How to move a value in array?
How to move a value in array?
how i can creat string array, with global visibility.
how i can creat string array, with global visibility.
how to check and print the no of times an integer is repeated in an array
ModuleNotFoundError: No module named 'queuey'
how to store jtable value in multidimensional array?
how to store jtable value in multidimensional array?
Shift Array Elements in Java
JavaScript array print
How to Prepend Array in PHP
i need to print customer[1] is abcd,cbnb using array
i need to print customer[1] is abcd,cbnb using array
i need to print customer[1] is abcd,cbnb using array
i need to print customer[1] is abcd,cbnb using array
ARRAY ELEMENTS - Java Interview Questions
How can i Change Button Label Value Randomly in VIRTUAL KEYBOARD using JAVA or Net Beans ???
How can i Change Button Label Value Randomly in VIRTUAL KEYBOARD using JAVA or Net Beans ???
How do I initialize a byte array in Java?
How can print integer in method
Find sum of the squares of Array elements
I want to know the all possible syntax for EL code to print the first element of an array.
ModuleNotFoundError: No module named 'queuey-py'
please tell anybody how can i set a value in hiperlink for edit n delete link
ModuleNotFoundError: No module named 'print_array'
Find in Array - Calculate Occurrences of Elements in Array
how do i begin a two dimensional array?
how insert data from databse in array and compare new data to already stored value in array
How to load elements from db when i press next.
Selecting elements of 2D array with GUI
JavaScript array get elements at random
print array in following format
How to transfer the value of a long  array into long buffer.
base the value of first combo box, how i display the second combox - JSP-Servlet
how can i display a pdf file in a jtextarea
How can I do it? .click();
Multiply a range of array elements using Recursion
How can I learn Java?
please please i wanna insertion sort program find calendar to array value (1000,5000,10000), please help me
 ShortBuffer in java, Transfer the array's elements into short buffer.
ModuleNotFoundError: No module named 'queued'
Re: base the value of first combo box, how i display the second combox - JSP-Servlet
JavaScript Array
Simplest way to print an array in Java

Ads