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
trapecia [35]
3 years ago
11

Assume variables SimpleWriter out and int n are already declared in each case. Write a while loop that printsA. All squares less

than n. For example, if n is 100, print 0 1 4 9 16 25 36 49 64 81.B. All positive numbers that are divisible by 10 and less than n. For example, if n is 100, print 10 20 30 40 50 60 70 80 90C. All powers of two less than n. For example, if n is 100, print 1 2 4 8 16 32 64.
Computers and Technology
1 answer:
REY [17]3 years ago
5 0

Answer:

This program has been written using JAVA. The code is written beloe:

// import library

import java.util.Scanner;

public category Main operate

public static void main(String[] args)

{

// scanner category

Scanner scan=new Scanner(System.in);

System.out.println("Enter Number:");

int n=scan.nextInt();

//All squares but n

System.out.println("All squares but n are: ");

int temp=0,square=0,i=0;

while(square

range

square=i*i;

if(square>=n)break;

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

i++;

}

//All positive numbers that are divisible by 10 but less than n

System.out.println(" ");

System.out.println(" ");

System.out.println("All positive numbers are divisible by 10 and less than n are: ");

i=1;

while(i

{

if(i%10==0)

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

if(i>=n)break;

i++;

}

System.out.println(" ");

System.out.println(" ");

System.out.println("All powers of 2 that are less than n are: ");

//All powers of 2 less than n

i=0;

while(i

mathematics.pow(2, i);

if(num_power

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

i++;

}

}

}

Explanation:

With SimpleWriter out and int n already declared in each case this program makes use of a while loop condition to satisfy the following;

1. All squares less than n

2. positive numbers that are divisible by 10 and less than n.

3. All powers of two less than n.

You might be interested in
What HTML tag would you use to indicate a line break?
DIA [1.3K]

Answer:

<br> APEX Verified

Explanation:

8 0
3 years ago
Can anyone help? Please.
Shtirlitz [24]
I can’t see it... can you type it out please?
3 0
3 years ago
Read 2 more answers
A domestic air carrier airplane lands at an intermediate airport at 1815Z. The latest time it may depart without a specific auth
serious [3.7K]

Answer:

A domestic air carrier airplane lands at an intermediate airport at 1815Z. The latest time it may depart without a specific authorization from an aircraft dispatcher is <u>1915Z (1 hour)</u>.

Explanation:

Under the domestic operations, an airplane landed on intermediate airport can remain their for not more than one hour so the time would me 1 hour.

Here the time represented by 1815Z and 1915Z is in Zulu Time Zone as depicted from letter "Z". The first two digits represent the hour (0-24) and the next two represent the minutes (0-59).

  • Here the landing time is 6:15 pm while departing time is after one hour that is 7:15 pm (1915Z).

i hope it will help you.

6 0
3 years ago
Gps receivers are commonly used by individuals to determine their geographic location while hiking and to obtain driving directi
soldier1979 [14.2K]
I think it is true also.
7 0
3 years ago
What are the chances that we are living in a simulation? (Percentage)
harkovskaia [24]
Round about 95% Chance to living in a Simulation
5 0
3 years ago
Read 2 more answers
Other questions:
  • Whereas lines of competition are clearly defined in the more established industries, in the Internet industry they are blurred a
    9·1 answer
  • Which of these statements best describes an application programming interface?
    5·1 answer
  • Write a Python program that will take as input 5 integer values and will output the average of the odd values and the average of
    6·1 answer
  • The problem of using IP numbers for addressing hosts in the Internet are resolved using
    5·1 answer
  • Explain how Deep Packet Inspection works (DPI). How is this technology beneficial to Perimeter Security? Lastly, describe a scen
    6·1 answer
  • In which step of writing a program does a programmer first use a<br> compiler?<br> documentin
    6·1 answer
  • What does a proxy server do?<br> Help please!!
    12·1 answer
  • What is trouble shoot​
    11·1 answer
  • Question 6 of 10
    11·1 answer
  • Different algorithms can be made to complete the same task in different ways.
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!