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
Alice is an investor who has created a device controlled by an app that will water plants automatically. Alice has no experience
oksian1 [2.3K]

Answer:

3rd one

Explanation:

took test

5 0
3 years ago
Determine whether the compound condition is True or False. 2&lt;3 and 5&lt;1.3&lt;3 and 1≤1. not (2==3). true false cannot be de
seraphim [82]

Answer:

False

Explanation:

The second bool operation results to false since 5 is not less than 1.3

5 0
3 years ago
Read 2 more answers
Which is an example of synchronous communication. Text message e-mail voicemail telephone conversation
enot [183]

Answer:

Text Messages

Explanation:

Synchronous communication is a simultaneous communication between two people. This is the type of serial communication where two person can communicate at the same time. This type of communication exclude face to face communication and phone communication.

for example

during Chat when we are taking to someone he also can reply the same time.

3 0
3 years ago
Read 2 more answers
You can move to the previous or next sheet by pressing the ____ keys.
Paladinen [302]
<span>ctrl+pg up (or ctrl) + pg down</span>
8 0
3 years ago
ساعدوني على الإجابة على هذه الأسئلة
aleksandr82 [10.1K]

Answer:

Can you Translate for Russian or Eanglish

Explanation:

7 0
3 years ago
Other questions:
  • They predicted another cold day in Seattle. They predicted another windy day in Seattle. Combine the sentences into one sentence
    8·1 answer
  • Which of the following careers is part of the Printing Technology pathway?
    10·1 answer
  • "Select the computing device that uses a limited version of an operating system and uses a web browser with an integrated media
    12·1 answer
  • Nilsu is attempting to train a new administrative assistant on using a word processing program. Since the program is fairly comp
    15·1 answer
  • Read the Python program below: num1 = int(input()) num2 = 10 + num1 * 2 print(num2) num1 = 20 print(num1) Question 1 When this p
    6·1 answer
  • All of the following are technical solutions to protecting user privacy except: Group of answer choices Data use policies Anonym
    12·1 answer
  • Why can a bank afford to pay an interest rate on a savings account?
    11·1 answer
  • Gavin is making a new logo for his business. He uses drawing software to create a unique. Which file format does he use to creat
    5·1 answer
  • 1. If we want define style for an unique element, then which css selector will
    14·1 answer
  • Does anyone have any tips on how to begin a 10 page Capstone project paper? I've got to write a write a research paper on the ty
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!