1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Licemer1 [7]
3 years ago
11

What is the output of the below Java program?

Computers and Technology
1 answer:
patriot [66]3 years ago
3 0

Answer:

If you fix your program: instead of "while (a=4)" you will have: while(a<4)

It wil print:

> 123

Explanation:

You can check the output of that kind of programs in online repl consoles e.g: https://repl.it/languages/java10

You might be interested in
Why does a computer need programs? ​
Yuri [45]
To run successfully. That was the answer on my quiz. Sorry if it doesn’t help
3 0
3 years ago
Read 2 more answers
What aspect of web design is Gloria following when she uses the same color
tresset_1 [31]
The answer to this is C
4 0
3 years ago
Read 2 more answers
Problem 8 - Recursive Divisible by 3 and 5 Complete the divBy3And5 function which accepts a list of integers. The function shoul
slavikrds [6]

The recursive function divBy3And5 is defined in Python and is found in the attached image.

In the base case, the function divBy3And5 tests if the input list is empty. If so, the tuple returned is (0, 0). This means no numbers are divisible by three and no numbers are divisible by five.

The recursive step gets the first element of the list and

  • If divisible by 3, it sets <em>count_of_3</em> to 1, else it leaves it as 0
  • If divisible by 5, it sets <em>count_of_5</em> to 1, else it leaves it as 0

It then makes a recursive call on the remaining elements, and stores it in a variable as follows

   <em>divBy3And5_for_remaining_elem</em> = divBy3And5(remaining_elements)

Then, it returns the tuple

       (<em>divBy3And5_for_remaining_elem</em>[0] + <em>count_of_3</em>,

                <em>divBy3And5_for_remaining_elem</em>[1] + <em>count_of_5)</em>

Learn more about recursion in Python: brainly.com/question/19295093

5 0
2 years ago
write a single expression that will return true if the lower four bits of x are the same as the lower four bits of y
horrorfan [7]

A single expression that will return true if the lower four bits of x are the same as the lower four bits of y is; (x & 0x0F) == (y & 0x0F)

<h3>How do you write single expression programs?</h3>

There are different methods of writing programs such as python and others. However, in this case, it is pertinent to know that this compiler that will return true if the lower four bits of x are the same as the lower four bits of y doesn't accept binary constants and as such we will use hexidecimal instead. For example; for 0b00111111, we will use 0x3F.]

Thus, using that same concept above, the single expression that will return true if the lower four bits of x are the same as the lower four bits of y is; (x & 0x0F) == (y & 0x0F)

Read more about writing computer programs at: brainly.com/question/16397886

6 0
2 years ago
Programming CRe-type the code and fix any errors. The code should convert non-positive numbers to 1.
LUCKY_DIMON [66]

Answer:

Given

The above lines of code

Required

Rearrange.

The code is re-arrange d as follows;.

#include<iostream>

int main()

{

int userNum;

scanf("%d", &userNum);

if (userNum > 0)

{

printf("Positive.\n");

}

else

{

printf("Non-positive, converting to 1.\n");

userNum = 1;

printf("Final: %d\n", userNum);

}

return 0;

}

When rearranging lines of codes. one has to be mindful of the programming language, the syntax of the language and control structures in the code;

One should take note of the variable declarations and usage

See attachment for .cpp file

Download cpp
5 0
4 years ago
Other questions:
  • The __________ format is a proprietary file format defined by guidance software for use in its forensic tool to store hard drive
    15·1 answer
  • What is a programming language?
    11·2 answers
  • History timeline: who developed what elements first Windows OS and Apple OS?
    13·2 answers
  • In C++ please.
    8·1 answer
  • Uinjsiodj9fijsdiokjdwe0okakj09dw9j09jw09
    9·2 answers
  • Felicity wants to capture the attention of the regular subway commuters in her area though her print advertisements​
    13·1 answer
  • Assume variable age = 22, pet = "dog", and pet_name = "Gerald".
    6·1 answer
  • Collection activities acquire and extract data from the operational environment such that Processing and Exploitation can conver
    14·1 answer
  • State two differences between a mouse pointer and a mouse cursor​
    10·2 answers
  • Explain external interface bus
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!