Answer:
A LAN
Explanation:
A LAN, or a Local Area Network, is a network of devices typically within 10 meters of range regardless of what it is built around.
Answer:
Option D The negative number entered to signal no more input is included in the product
Explanation:
Given the code as follows:
- int k = 0;
- int prod = 1;
- while (k>=0)
- {
- System.out.println("Enter a number: ");
- k= readInt( );
- prod = prod*k;
- }
- System.out.println("product: "+prod);
The line 7 is a logical error. Based on the while condition in Line 3, the loop shall be terminated if k smaller than zero (negative value). So negative value is a sentinel value of this while loop. However, if user enter the negative number to k, the sentinel value itself will be multiplied with prod in next line (Line 7) which result inaccurate prod value.
The correct code should be
- int k = 0;
- int prod = 1;
- while (k>=0)
- {
- prod = prod*k;
- System.out.println("Enter a number: ");
- k= readInt( );
- }
- System.out.println("product: "+prod);