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
Ava calls tech support because she is unable to send information that a customer has requested. The tech support person tells he
Blizzard [7]

Answer:

Outlook as it is a common email aplication which may experience some issues

Explanation:

7 0
3 years ago
“Click” is a type of user input the onEvent code checks for in order to perform actions like going to another screen. List at le
Sidana [21]

Answer:

typing, commands, scrolling. hope this helps

5 0
2 years ago
It is a good idea to include your teacher’s name on a title page.
LenaWriter [7]

Answer: I think it all depends on the teacher because I know one of my teachers like when we put their name on our assignments. So I pick true

Explanation:

6 0
3 years ago
Read 2 more answers
Brainly, ""helping you get better grades"
leonid [27]

Answer: What do you except? All of this is user generated..

Explanation:

5 0
3 years ago
Read 2 more answers
Please someone participate in my typing race ...
dsp73

Answer:

what is typing race

this link can not be clicked

8 0
3 years ago
Other questions:
  • Create a derived class called Car that inherits from Vehicle. The constructor should call the base class constructor, with 4 for
    13·1 answer
  • structured analysis is called a(n) _____ technique because it focuses on processes that transform data into useful information.
    5·1 answer
  • A ____ typically rests on the desk or other flat surface close to the user’s computer, and it is moved across the surface with
    13·1 answer
  • Assume that passwords are selected from four-character combinations of 26 alphabeticcharacters. Assume that an adversary is able
    11·1 answer
  • In this scenario, hackers launch cyber-attacks that affect several parts of the nationâs financial infrastructure over the cours
    8·1 answer
  • I neeeeeeeeeeeddddddddddddd help plz ppl
    10·2 answers
  • Aaron is stating the main idea of what he read in his own words. He is _____.
    11·2 answers
  • PLEASE ANSWER AND HURRY I'LL MARK YOU BRAINLIEST!!<br><br><br>​
    9·1 answer
  • Select all the correct answers.
    7·1 answer
  • What is an example of work performed by an integration platform as a service (ipaas)?
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!