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
According to Amdahl's Law, what is the speedup gain for an application that is 60% parallel and we run it on a machine with 4 pr
rodikova [14]

With four processing cores, we get a speedup of 1.82 times.

<h3>What is Amdahl's Law?</h3>

Amdahl's law exists as a formula that provides the theoretical speedup in latency of the implementation of a task at a fixed workload that can be expected of a system whose resources exist improved.

Amdahl's law exists that, in a program with parallel processing, a relatively few instructions that hold to be completed in sequence will have a limiting factor on program speedup such that adding more processors may not complete the program run faster.

Amdahl's law stands also known as Amdahl's argument. It is utilized to find the maximum expected progress to an overall system when only part of the system exists improved. It is often utilized in parallel computing to indicate the theoretical maximum speed up utilizing multiple processors.

Hence,  With four processing cores, we get a speedup of 1.82 times.

To learn more about Amdahl's Law refer to:

brainly.com/question/16857455

#SPJ4

6 0
2 years ago
the two main forces acting on a computer that sits on a table are _________ and _________. a. weight; gravity b. weight; mass c.
EleoNora [17]
It is A.weight: gravity
8 0
3 years ago
Read 2 more answers
How will 5G technology affect the current classroom? What are some concerns about 5G technology? Is 5G technology worth the risk
notsponge [240]

Answer:Death is a risk of 5g towers

Explanation:Someone caught a video of birds falling dead out of the sky because of the radiation from the 5g towers. There is enough radiation to make your eyes melt before you get close to it.

4 0
3 years ago
Consider the use of 1000-bit frames on a 1-Mbps satellite channel with a 270-ms delay. What is the maximum link utilization for,
natka813 [3]
I feel as if it would be B.
5 0
3 years ago
What time of year, or during what event, do companies spend the most money to advertise?
Triss [41]
A lot of times companies spend lots of money on ads during the holiday season and spend even more as it gets closer to Christmas. Some companies spend even more money during the Super Bowl.<span />
7 0
3 years ago
Other questions:
  • The purpose of the ________ element is to describe the contents of a table.
    15·1 answer
  • How might writing an online journal be different than writing in a paper one ​
    15·2 answers
  • Which of the following is defined as the elastic leasing of pooled computer resource over the Internet? 1) Broadband 2) Wiki 3)
    13·1 answer
  • Did anyone else remember that Unus Annus is gone? I started crying when I remembered.... Momento Mori my friends.... Momento Mor
    9·2 answers
  • it is used to hold screws, jumpers, fasteners, and other small parts and prevent them from getting mixed together​
    15·2 answers
  • You are studying for a test tomorrow. Your friends invite you to
    12·1 answer
  • I will have to goste yall im busting my butt off doing homework
    10·2 answers
  • Why would over-50 executives have a harder time buying into the idea of social media?​
    15·1 answer
  • The act of getting information out of memory storage
    6·1 answer
  • Which of the following is NOT a best practice to protect data on your mobile computing device?
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!