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]
2 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]2 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
All of the following are incentives proprietary schools use to attract a student except
IRISSAK [1]
Idk what the answer choices are
4 0
3 years ago
Read 2 more answers
Do you think our attitude (whether positive or negative) is something we are born with or that we have power to control within o
maks197457 [2]

Answer:

Yes. I do believe that having a positive attitude about our current situation helps with over coming the struggles of it all.

Explanation:

i once had a negative out look on this online school but now that we've reached the end (at my school I've recognized it wasn't too bad after all while doing the work I've learned it helps to listen to some music or watch an video or two from one of my favorite you-tubers and also talking to my friends through apps.

hope this helps.

8 0
3 years ago
Read 2 more answers
How do users log into Windows 8?
bogdanovich [222]
I think it’s swipe up if i’m correct, if not sorry
5 0
3 years ago
What are some ways to insert a row or column? Check all that apply.
kondaur [170]

Answer:

There are two ways to insert the new column or row in the table.

Explanation:

<u>Method I</u>

i. Select the cell where you want to add a new row or column,

ii. Click on Home Tab

iii. Find insert button in Cells Group.

iv. Click on Insert Row or Insert Column button.

By following above mentioned steps we can add a row or column in Excel sheet.

<u>Method II</u>

i. Select the cell where you want to add a new row or column,

ii. Right Click on the selected Cell.

iii. Find Insert Button in drop down menu and Click on Insert.

iv. There are four options in POP menu, choose Entire Row or Entire Column to insert row or column.

4 0
3 years ago
Read 2 more answers
Which of the following documents cannot be created using the Microsoft® Word® application?
denis23 [38]
The correct answer is C. Customer spreadsheet
7 0
3 years ago
Read 2 more answers
Other questions:
  • Knowing the meaning of the acronym WYSIWYG can be most helpful to you when you
    14·1 answer
  • If there are no differences between the amino acid sequences in the cytochrome c protein of humans and chimpanzees why aren't we
    15·1 answer
  • Write a program that takes a date as input and outputs the date's season. The input is a string to represent the month and an in
    6·1 answer
  • How does the access point know whether a wireless data packet is intended for its network?
    14·1 answer
  • As the operations manager for a supermarket chain, Mai needs to find a telecommunications technology that: enables managers in r
    9·1 answer
  • How to block someone from watching your youtube videos?
    12·2 answers
  • To execute a prepared SQL statement, you can use the ________________ and execute() methods of the PDOStatement object to set pa
    10·1 answer
  • True/False
    15·1 answer
  • What is Stefen Salvators mom name? For the tvd fans
    12·2 answers
  • Is anyone a robIox moderator?
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!