menu
QAmmunity.org
Login
Register
My account
Edit my Profile
Private messages
My favorites
Ask a Question
Questions
Unanswered
Tags
Categories
Ask a Question
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.
asked
Nov 6, 2017
230k
views
3
votes
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.
Computers and Technology
high-school
RabidFire
asked
by
RabidFire
8.4k
points
answer
comment
share this
share
0 Comments
Please
log in
or
register
to add a comment.
Please
log in
or
register
to answer this question.
1
Answer
4
votes
//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
Wazy
answered
Nov 11, 2017
by
Wazy
7.4k
points
ask related question
comment
share this
0 Comments
Please
log in
or
register
to add a comment.
← Prev Question
Next Question →
Related questions
asked
Jul 14, 2024
127k
views
1. Write a loop that reads positive integers from standard input, printing out those values that are even, each on a separate line. The loop terminates when it reads an integer that is not positive. 110132013301-1
Uhkkgjhfjf Jgkjkhj
asked
Jul 14, 2024
by
Uhkkgjhfjf Jgkjkhj
9.0k
points
Computers and Technology
high-school
1
answer
4
votes
127k
views
asked
May 21, 2017
8.7k
views
Write a loop that reads positive integers from standard input, printing out those values that are greater than 100, and that terminates when it reads an integer that is not positive. the values should
Lianna
asked
May 21, 2017
by
Lianna
7.8k
points
Computers and Technology
high-school
1
answer
4
votes
8.7k
views
asked
Dec 20, 2018
28.4k
views
1))a loop that reads positive integers from standard input, printing out those values that are greater than 100, and that terminates when it reads an integer that is not positive. The values should be
Camo
asked
Dec 20, 2018
by
Camo
8.3k
points
Computers and Technology
high-school
1
answer
4
votes
28.4k
views
Ask a Question
Welcome to QAmmunity.org, where you can ask questions and receive answers from other members of our community.
9.5m
questions
12.2m
answers
Other Questions
“What does it mean when we “rework” copyrighted material?”
The book shows how to add and subtract binary and decimal numbers. However, other numbering systems are also very popular when dealing with computers. The octal (base 8) numbering system is one of these.
Seven basic internal components found in a computer tower
describe an advance in technology that makes life more enjoyable. what discoveries contribute to this technology?
Disadvantages of using animation in advertising? advantages and disadvantages of using animation for education? advantages and disadvantages of using animation in entertainment?
Twitter
WhatsApp
Facebook
Reddit
LinkedIn
Email
Link Copied!
Copy
Search QAmmunity.org