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
julia-pushkina [17]
4 years ago
3

5.4.2: While loop: Print 1 to N. Write a while loop that prints from 1 to user_num, increasing by 1 each time. Sample output wit

h input: 4 1 2 3 4
Computers and Technology
1 answer:
worty [1.4K]4 years ago
3 0

Answer:

import java.util.Scanner;

class Main {

 public static void main(String[] args) {

   Scanner in = new Scanner(System.in);

   System.out.println("Enter a number");

   int user_num = in.nextInt();

   int n = 1;

   while(n <= user_num){

     System.out.print(n+" ");

     n++;

   }

 }

}

Explanation:

  • Import Scanner to receive user number
  • Create and initalize a new variable (n) to be printed out
  • Set the while condition to while(n <= user_num)
  • Print the value of n after each iteration and increment n by 1
You might be interested in
Which is the default data type of Ms-Access? (i) Memo (ii) Number (iii) Text (iv) Auto number​
Gala2k [10]

Answer:

(iii) Text

Explanation:

A database management system (DBMS) can be defined as a collection of software applications that typically enables computer users to effectively and efficiently create, store, modify, retrieve, centralize and manage data or informations in a database. Thus, it allows computer users to efficiently retrieve and manage their data with an appropriate level of security.

Generally, a database management system (DBMS) acts as an intermediary between the physical data files stored on a computer system and any software application or program.

Hence, a software that enables the organization to centralize data, manage the data efficiently while providing authorized users a significant level of access to the stored data, is called a Data Base Management System (DBMS).

Text is the default data type of Microsoft Access (Ms-Access).

7 0
3 years ago
. What is the final value of “y” after this for loop is finished? for (y = 3; y&lt;=14; y+=5)
SIZIF [17.4K]

Answer:

18

Explanation:

In First iteration y  = 3 and condition is y<=14 i.e. 3<=14 means true and continue the loop and increment the value of y by 5, means y will become 8

In Second iteration y  = 8 and condition is y<=14 i.e. 8<=14 means true and continue the loop and increment the value of y by 5, means y will become 13

In Third iteration y  = 13 and condition is y<=14 i.e. 13<=14 means true and continue the loop and increment the value of y by 5, means y will become 18

In Fourth iteration y  = 18 and condition is y<=14 i.e. 18<=14 means false and exit from the loop

So the value of y will be 18 after the loop

6 0
3 years ago
Лемма деген не<br> конспект
xxMikexx [17]

huh? ano daw? kfjfdkvdddddddddddddddd

4 0
3 years ago
American company Software Unlimited is planning to expand its operations to the Bangor Republic where the group is the primary u
FinnZ [79.3K]

Answer:E. Employees will achieve close cooperation with others.

Explanation: Employees will close cooperation with others as a result of the expansion of the company to the Bangor Republic where the group is the primary unit of social organisation, When a company expands to new locations it boosts employment morale and corporation as they find it as a form of expansion and overall good of the employees and their employer, most of expand as a result of favourable economic climates.

7 0
3 years ago
Help with this!!!!!!!!
sergejj [24]
I think its false?? but I'm not sure
7 0
3 years ago
Read 2 more answers
Other questions:
  • You are given a string of n characters s[1 : : : n], which you believe to be a corrupted text document in which all punctuation
    12·1 answer
  • What is the last step in conducting a URL search
    11·2 answers
  • A(n)___ is divided into rows and columns.<br> What goes in the blank?
    7·1 answer
  • What are some programs that you have used that have condition-controlled loops and count-controlled loops?
    10·1 answer
  • IN YOUR OWN WORDS, create a new thread and compare and contrast paraphrasing, summarizing, and quoting and how to do each succes
    14·1 answer
  • What is the main advantage of a bitmap image?
    6·1 answer
  • landon starts his computer and gets message, hard drive is not found. He was watching a movie the previous night, what might the
    6·1 answer
  • 1. (1 pt) Suppose you wish to run a program P with 37.5 x 109instructions on a 15 GHz machine with a CPI of 0.75. What is the ex
    9·1 answer
  • Who first demonstrated the computer mouse ?
    11·1 answer
  • Brian needs to see the space available to insert content on a slide in his presentation which feature of the presentation should
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!