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
Shalnov [3]
4 years ago
10

Write a loop to print 10 to 90 inclusive (this means it should include both the

Computers and Technology
1 answer:
Semmy [17]4 years ago
8 0

Answer:

The loop in cpp language is as follows.

for(int n=10; n<=90; n++)

{

cout<<n<<" ";

count = count+1;

if(count==10)

{

cout<<""<<endl;

count=0;

}

}

Explanation:

1. The expected output is obtained using for loop.

2. The loop variable, n is initialized to the starting value of 10.

3. The variable n is incremented by 1 at a time, until n reaches the final value of 90.

4. Every value of n beginning from 10 is displayed folllowed by a space.

5. When 10 numbers are printed, a new line is inserted so that every line shows only 10 numbers.

6. This is achieved by using an integer variable, count.

7. The variable count is initialized to 0.

8. After every number is displayed, count is incremented by 1.

9. When the value of count reaches 10, a new line is inserted and the variable count is initialized to 0 again. This is done inside if statement.

10. The program using the above loop is shown below along with the output.

PROGRAM

#include <stdio.h>

#include <iostream>

using namespace std;

int main()

{

   int count=0;

   for(int n=10; n<=90; n++)

   {

       cout<<n<<" ";

       count = count+1;

       if(count==10)

       {

           cout<<""<<endl;

           count=0;

       }

       

   }

   return 0;

}  

OUTPUT

10 11 12 13 14 15 16 17 18 19  

20 21 22 23 24 25 26 27 28 29  

30 31 32 33 34 35 36 37 38 39  

40 41 42 43 44 45 46 47 48 49  

50 51 52 53 54 55 56 57 58 59  

60 61 62 63 64 65 66 67 68 69  

70 71 72 73 74 75 76 77 78 79  

80 81 82 83 84 85 86 87 88 89  

90

1. In the above program, the variable count is initialized inside main() but outside for loop.

2. The program ends with a return statement since main() has return type of integer.

3. In cpp language, use of class is not mandatory.

You might be interested in
Which of the following activities do not involve Information technology​
m_a_m_a [10]

Answer:

You didn't add any information technology sentence below

: / Have a great day

8 0
3 years ago
Write python code that does the following.
Mariulka [41]

Answer:

the answers are in front of you it is correct to follow the steps

¯\_(ツ)_/¯:

5 0
3 years ago
What is the biggest difference between single system recording and double system recording?
Alinara [238K]

The most significant difference between single and double system recording is where the audio sound is recorded from. In a double system recording, the images and the sound are recorded in two different devices. Sound is recorded on the first device, and the picture and the reference audio is recorded on the second device. On the other hand, in a single system, the audio is captured silmutaneously with the image on the same device. The double recording system is used more so if you do not have a camera that has an advanced audio quality input. If you have a dedicated audio device that can capture audio on an independent device, then you will be guaranteed to get a robust sound quality.

7 0
3 years ago
An object on the computer use to store data, information and settings is known as?​
kodGreya [7K]

Answer:

hard drive

Explanation: im sure tell me if its right

6 0
3 years ago
Read 2 more answers
Why are large commercial companies interested in developing mobile apps for smartphones?
loris [4]
Because they can make a lot of money if they create a popular application.
7 0
3 years ago
Other questions:
  • An “AI” (artificial intelligence) could be used in:
    10·1 answer
  • A client is concerned that a power outage or disaster could impair the computer hardware's ability to function as designed. The
    13·1 answer
  • The LTE (cellular telephone) standard supports only packet switching"". What cellular services are morst affected by this change
    15·1 answer
  • Diane wants to maintain a record of percent change in sales from the year 2000 to the present year. She enters the values of per
    10·1 answer
  • _____ can analyze the content of social media communications within the context of a specific brand or product and determine wha
    13·1 answer
  • Which of the following statements is not true? Group of answer choices
    9·1 answer
  • PLS ANSWER ASAP!
    9·1 answer
  • Is number 1 correct​
    7·2 answers
  • In which situations would it be most helpful to filter a form? Check all that apply.
    8·1 answer
  • Which of the following are the benefits of using Responsive Display Ads?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!