Tawann4e6Rabike
Tawann4e6Rabike Tawann4e6Rabike
  • 13-10-2016
  • Computers and Technology
contestada

Write a loop that reads positive integers from standard input, printing out those values that are greater than 100, each on a separate line, the loop terminates when it reads an integer that is not positive.

Respuesta :

hamwolf hamwolf
  • 13-10-2016
//use java not javascript
Scanner scan = new Scanner(s); 
int nums[] = new int[2000]; 
int value =1; 
int index = 0; 
\\loop for entering values and save those over 100 in an array 
While( value >= 0 ) \\ as long input is positive number loop continues 
{ 

System.out.print("Enter an integer : "); 
value = scan.nextInt( ); 
if(value > 100) 
{ 
nums[index] = value; 
index++; 
} 

} 

//Next loop prints the array contents on one line with one space 
for( int i =0; i < nums.length; i++) 
{ 
if(nums[i] > 100) 
System.out.print(n
Answer Link

Otras preguntas

I need some help with this.
webmaster@blanket.com is an example of
What is the value of the discriminant of 0=-2x^2+6x+13
What would a prognosticator do?
When a story is told from the _____, the narrator has full knowledge of all the characters. A. unreliable first-person point of view B. reliable first-per
Which numbers belong to the solution set of the inequality? 9x>117
_____ leaders communicate a sense of mission, stimulate new ways of thinking, and enhance as well as generate new learning experiences.
French electric guitarist of vietnamese descent; from his 1995 album, tales from vietnam, the piece, ting ning, is based on a traditional vietnamese melody:
What is the measure of the angle that complements a 30° angle? 30° 60° 75° 90°
During weight training, when should you inhale? A. On the lift B. On the recovery C. Before the set D. After the set