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

Write a while loop that prints

Computers and Technology
1 answer:
Nana76 [90]3 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
Creating a newsletter
pav-90 [236]
This isn’t helpful considering no one knows what type of news letter you want
6 0
3 years ago
HTML is the authoring language developed to create web pages and define structure and layout of a web document
Eduardwww [97]

Answer:

true

Explanation:

7 0
3 years ago
Read 2 more answers
Difference between multi-national and global company​
trapecia [35]

A multinational corporation, or MNC, is a company which produces goods and services and has offices in several other countries while a global corporation or company is a company which also has trade relations with several other countries. ... MNCs have official headquarters while global companies do not.

5 0
3 years ago
Read 2 more answers
It is easier to make an object move across the screen by using the tweening function rather than creating each individual frame
Vesna [10]
Uhhhh I believe it’s true if it’s wrong I’m srry ....
3 0
3 years ago
____ is designed for short-distance connections and has only a few lambdas, with a greater space between lambdas. Group of answe
givi [52]

Answer:

The answer is Coarse wavelength division multiplexing (CWDM)

Explanation:

CWDM is the wavelength designed for short- distance connections  and has only a few lambdas. It is mostly used nowadays as a type of wavelength technologies deployed in cities and inner access ways. It is inexpensive and thus a cost effective wavelength  division multiplexing. Cost effective lasers can be used in CWDM due to the spacing of about 20nm between its wavelengths.

4 0
3 years ago
Read 2 more answers
Other questions:
  • Write a Python program that gets a single character from the user and writes out a congratulatory message if the character is a
    9·1 answer
  • How is a cell named?
    12·1 answer
  • Data that are collected on large populations of individuals and stored in databases are referred to as _____.
    15·1 answer
  • What are two constraints that continuous-media files have that conventional data files generally do not have?
    12·1 answer
  • An email address contains the @ character. Write a program that takes asks for an email address input from the user and determin
    5·1 answer
  • Dan works for an automobile company. He has designed a new model of a car based on an older version. Which technology can he use
    6·1 answer
  • Why is the cost of a software project not directly related to the cost of development?
    13·1 answer
  • State all the generations of computers.
    10·2 answers
  • What does it mean for a heap to be complete?
    7·1 answer
  • Help me decide this hurry
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!