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 selection below does not represent a workable IP address?
gogolik [260]

Answer:

ipv4 ip addresses will be 4 sets of numbers to a maximum of 255 per set ie the highest ipv4 number is 255.255.255.255 ipv6 use hexadecimal and has many more addresses ie ipv6 0:0:0:0:0:ffff:ffff:ffff is = to ipv4  255.255.255.255

Explanation:

8 0
3 years ago
You need to write th java syntax for the expression “7 is greater than or equal to 3” choose the best answer
shtirl [24]
If(7>=3)
{
.
.
.
}
Mark as brainliest
8 0
4 years ago
The computer has had far-reaching effects on our lives.how has the computer effected your life?
Elden [556K]

Answer: The computer is one of the greatest inventions of human history. The computer has had effect on the lives of each and ever individual. The computer has lead to the birth of digital global world with all the transaction and governance systems being digitalised.

Explanation:

Computer has itself made into a big profession with many innovations still being carried out. Due to internet technologies people have become connected more and more and are able to know the details of any news happening anywhere. It has also  increased the knowledge level of people in all the developed and developing nations.

It has increased the ease of everyday life.

8 0
3 years ago
Why is it preferable to code web pages in HTML format?
balu736 [363]

Answer:

its c on plato

Explanation:

5 0
3 years ago
Why was manufacturing such a slow and costly process before the Industrial Revolution?
ohaa [14]

Answer:

work was done by hand

Explanation:

Back then they didn't have machines

hope this helped

~chara

8 0
3 years ago
Other questions:
  • Question 1 of 20 :
    15·2 answers
  • Using the drop-down menus, correctly complete the sentences.
    5·2 answers
  • What software development model focuses on improving the product in small steps each time through the cycle?
    14·2 answers
  • hich of the following is a disadvantage of online surveys? They result in high response bias They lead to higher cost per comple
    14·1 answer
  • Beverly is creating a website for her new clothing company. Aside from including photographs, how can she use the index page to
    8·2 answers
  • How does having weak security on your browser represent the weakest link in a network
    8·1 answer
  • Write the simulate method, which simulates the frog attempting to hop in a straight line to a goal from the frog's starting posi
    10·1 answer
  • Write two eaxmple of operating system​
    14·2 answers
  • 2. The<br>is the main and usually largest data storage hardware device in a computer​
    9·1 answer
  • Briefly describe the function of options in a linux command and give an example of a useful option.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!