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
Explain: The fetch part of fetch decode execute cycle
MArishka [77]

Answer:

Look at the image

Explanation:

7 0
3 years ago
What process sends ones and zeroes across network cables
sergejj [24]

Answer:

modulation

Explanation:

Modulation is the procedure of encoding data into electrical signals for transmission through a media. For transmission, binary information, denoted by a sequence of ones and zeros, should be translated to analog or digital electrical signals. The method converts data into electrical signals suited for transmission is known as modulation.  Digital modulation is the transmission of binary signals zeroes and ones.

5 0
2 years ago
In what type of attack does the attacker send unauthorized commands directly to a database?
Delvig [45]
SQL injection. This is usually cause by the programmer not making the program parse incoming text, therefore allowing an attacker to input database commands.
4 0
4 years ago
What type of database contains multiple collections of data that are related to one another cells
statuscvo [17]
The different types<span> of </span>databases<span> include operational </span>databases<span>, end-user </span>databases<span>, distributed </span>databases<span>, analytical </span>databases<span>, relational </span>databases<span>, hierarchical </span>databases<span> and </span>database<span> models. 

Source Bing</span>
7 0
3 years ago
Help helppppppppppppp
SOVA2 [1]
Dont click the link
6 0
3 years ago
Other questions:
  • Which option is a form of an assistive technology?
    7·1 answer
  • What most distinguishes projects with a strong need for computer animation from projects without such a strong need?
    8·1 answer
  • Wrire a code that display elements at indices 1 and 4 in the follwoing array.
    12·1 answer
  • Meaning of page break​
    8·1 answer
  • You are planning trip to South America and and are worried about your devices with private keys being stolen. So you decide to s
    9·1 answer
  • Manuel owns a small business. He needs to calculate the amount each employee owes in Federal taxes. Manuel should
    11·2 answers
  • Ok so I know this is the most random question to ask on brainly, but does anyone know how to copy on placement in sims 4 for pc?
    14·2 answers
  • In this project you will write a set of instructions (algorithm). The two grids below have colored boxes in different
    9·2 answers
  • What does a production proposal provide ?
    7·2 answers
  • This question is related to linked-list representation of disjoint sets. Consider two sets Sx and Sy that have 3 and 5 elements,
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!