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
Maksim231197 [3]
4 years ago
13

Write a while loop that prints

Computers and Technology
1 answer:
Nana76 [90]4 years ago
6 0

Answer:

The program to this question as follows:

Program:

#include <iostream> //defining header file

using namespace std;

int main() //defining main method

{

int squ=0,n=0; //defining variable

cout<<"Square between 0 to 100 :"; //message

while(n<100) //loop for calculate Square

{

n=squ*squ; //holing value in n variable

cout<<n<<" "; //print Square

squ++; //increment value by 1

}

cout<<endl; //for new line

n=1; //change the value of n

cout<<"Positive number, which is divisible by 10: "; //message

while (n< 100) //loop for check condition

{

if(n%10==0) //check value is divisible by 10

{

cout<<n<<" ";//print value

}

n++; //increment value of n by 1

}

cout<<endl; //for new line

cout<<"Powers of two less than n: "; //message

n=1; //holing value in n

while (n< 100) //loop for check condition

{

cout<<n<<" ";//print value

n=n*2; //calculate value

}

return 0;

}

Output:

Square between 0 to 100 :0 1 4 9 16 25 36 49 64 81 100  

Positive number, which is divisible by 10: 10 20 30 40 50 60 70 80 90  

Powers of two less than n: 1 2 4 8 16 32 64  

Explanation:

In the above program, two integer variable "squ and n" is defined, then three while loop is declared, which is used to calculate different values, that can be described as follows:

  • In the first while loop both "n and squ" variable is used, in which n is used for check range and "squ" is used to calculate the square between 1 to 100.
  • The second, while it is used to calculate the positive number, which is divisible by 10, in this only n variable is used, that calculates the value and check its range.
  • Then the last while loop is used which is used to calculate the double of the number, which is between 1 to 100 range.  
You might be interested in
Explain the concept of scalability. How would you respond?
pantera1 [17]

Answer:

In computer science, scalability is the ability of an application or product that could be software or software to continue responding well when its context is increased in volume or size to meet the user demand. Typically, when a product becomes aging or the context demands a rescaling to a larger size or volume, if the product is prepared to respond to this demand, then it's called a scalable product.

6 0
3 years ago
can anyone sub to my youttube channel pls, its called Yakobu, and Im trying to reach 100 subs by the end of the month :)
allsm [11]

Answer:

Sure

Explanation:

3 0
3 years ago
Software that helps you navigate the web is called
Oksana_A [137]
Software that helps you navigate the web is called a web browser
7 0
3 years ago
The best way to find out the average salary in your company is to perform a technique, known as Advanced Calibrated Sampling (AC
Setler [38]

Answer:

Agree

Explanation:

The best way to find out the average salary in your company is to perform a technique, known as Advanced Calibrated Sampling (ACS).

7 0
3 years ago
A server core installation can't be converted to a minimal server interface.
11Alexandr11 [23.1K]
True.... ca i have brainliest?
3 0
3 years ago
Other questions:
  • ________ is the gathering, organizing, sharing, and analyzing of the data and information to which a business has access.
    6·1 answer
  • Common input devices include the keyboard, ____, and integrated video cameras.
    12·1 answer
  • What type of multimedia is a game CD? Game CDs are examples of ___ multimedia.
    15·2 answers
  • Solid state components are less likely to fail because they:______.a. are driven by precise sets of software instructions. b. ha
    8·1 answer
  • Write a program that dynamically allocates an array large enough to hold a user-defined number of test scores. Once all the scor
    5·1 answer
  • Java: Programming Question: Reverse OrderWrite a program that reads ten integers into an array; define another array to save tho
    10·1 answer
  • The Fast as Light Shipping company charges the following rates. Weight of the item being sent Rate per 100 Miles shipped 2kg or
    13·1 answer
  • What are some ways you can work with templates? Check all that apply.
    9·2 answers
  • Using the _____, you can direct the browser to retrieve specific information about the URL, to reload the current page, or to lo
    8·1 answer
  • Write a function solution that given an array a of n integers (between -100 and 100), returns the sign (-1,0,1) of product of al
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!