What output will be produced by the following code?

```
public class Demo {
public static void main(String[] args) {
System.out.println("The output is:");
bar(11156);
System.out.println();
}
public static void bar(int number) {
if (number > 0) {
int d = number % 10;
boolean odd = (number / 10) % 2 == 1;
bar(number / 10);
if (odd)
System.out.print(d / 2 + 5);
else
System.out.print(d / 2);
}
}
}
```


The output is:
05578

This code is in Demo2.java.

Computer Science & Information Technology

You might also like to view...

A zero on a relationship line indicates:

A) that the relationship line is undefined. B) the absence of any well-defined entities. C) that none is possible for the next relationship. D) that the relationship should be used to create an associative entity.

Computer Science & Information Technology

The item marked ____ in the accompanying figure is the Document window.

A. 2 B. 3 C. 4 D. 6

Computer Science & Information Technology

Briefly explain the types of switching on a network

What will be an ideal response?

Computer Science & Information Technology

A security engineer is faced with competing requirements from the networking group and database administrators. The database administrators would like ten application servers on the same subnet for ease of administration, whereas the networking group would like to segment all applications from one another.Which of the following should the security administrator do to rectify this issue?

A. Recommend performing a security assessment on each application, and only segment the applications with the most vulnerability B. Recommend classifying each application into like security groups and segmenting the groups from one another C. Recommend segmenting each application, as it is the most secure approach D. Recommend that only applications with minimal security features should be segmented to protect them

Computer Science & Information Technology