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
USPshnik [31]
3 years ago
14

Write code that prints: userNum ... 2 1 Print a newline after each number. Ex: userNum

Computers and Technology
1 answer:
ehidna [41]3 years ago
4 0

Answer:

The program to this question can be given as follows:

Program:

public class data //defining class data

{

//main method

public static void main (String [] as) //declaring main method  

{

int userNum = 4; //declare variable userNum and assign value

for (userNum = 1; userNum <= 4; userNum++)  //loop for print values

{

System.out.println(userNum);  //print values in new lines.

}

}

}

Output:

1

2

3

4

Explanation:

In the above java program code firstly a class "data" is defined, inside this class the main method is defined in which an integer variable userNum is defined that holds a value that is "4".

  • In this method, a for loop is declare that uses variable userNum which starts from 1 and ends with a given value that is equal to 4.
  • Inside a for loop, the print function is used that print userNum variable each values in the newline.  

You might be interested in
When Twitter is used to gather a large group for a face-to-face meeting it is called
Verdich [7]
The answer is flash mob. They called it flash mob when a large number of people in twitter gather in group for a centralized face to face meeting. In flash mob, people are gathering to be able to create a community that is helping each other or even just talking to each other.
8 0
3 years ago
ZeroIt is a function that takes one argument and returns no value. The argument is a pointer to int. The function stores the val
Sedbober [7]

Answer:

zeroIt(&x);

Explanation:

The statement that sets the value stored in x to zero by invoking the function zerolt is given below

zeroIt(&x);

The zeroIt function is also given below for better understanding.

void zeroIt(int *x) {

   *x = 0;

}

As seen, the function takes an argument with integer variable type, which is a pointer, denoted by the asterisk symbol (*x).

The ampersan sign (&x) is used to access the variable whose value can then be stored.

7 0
3 years ago
What programming language has dominated scientific computing over the past 60 years?
lord [1]

c++,  because it is considered as the mother of all programming languages. you can easily access other programming languages if you have a command on c++

7 0
1 year ago
If you're searching for a date and a product at the same time, you're running a _______ query. A. Complex B. Select C. Parameter
Andrews [41]

If you're searching for a date and a product at the same time, you're running a _______ query. A. Complex B. Select C. Parameter D. Range                                                                                                                                                                                                                                                         A. Complex

6 0
3 years ago
A strategy for speeding up hard drive performance is _________.
Daniel [21]

Answer:disk caching

Explanation:

Disk caching speeds up hard drive performance

7 0
3 years ago
Read 2 more answers
Other questions:
  • Read the scenario and answer the question. Audrey had problems with her computer software recently. One of her programs shut dow
    12·2 answers
  • Emma wants to create a web page for her school’s volleyball team. Which of these could she use?
    7·1 answer
  • Which type of network topology has a central networking device which manages the network and acts as a communications conduit fo
    7·1 answer
  • What kind of game was pole position?
    6·2 answers
  • As in algebra, you can use brackets to override the order of operations Excel follows to perform formula calculations. True or f
    13·1 answer
  • "Na2SO3” represents sodium sulfite.
    13·2 answers
  • How can Technology be used in marketing?
    5·1 answer
  • Pls someone help me with these four questions
    8·1 answer
  • Los organos de los sentidos perciben de la misma manera un estimulo?porque?
    8·1 answer
  • Question 5 / 15
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!