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

Ads
 

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

Ads









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 i print the selected content of a frame
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 Print Array in JavaScript
how to store jtable value in multidimensional array?
how to store jtable value in multidimensional array?
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 can print integer in method
please tell anybody how can i set a value in hiperlink for edit n delete link
How to Prepend Array in PHP
JavaScript array print
how to check and print the no of times an integer is repeated in an array
How can I do it? .click();
How do I initialize a byte array in Java?
How can I learn Java?
how should i can solve
how can i display a pdf file in a jtextarea
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.
How can you add elements of two arrayLists in java?
How can i search and insert within a query
how can i add hibernate plugin to eclipse?
how i can get jqfade.js library
how can i remove newline characters and tabs

Ads