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
Natali5045456 [20]
2 years ago
13

Assume you have a int variable n that has already been declared and initialized. Its value is the number of integers that need t

o be read in from standard input and printed out in sorted (ascending) order, each on a line by itself. Furthermore, there are no duplicates in the input and every number to be read is a non-negative value that is less than n's value. In this exercise you may not use any array (or fancy STL collection such as a vector). You may declare a variable or two as needed. With these restrictions, read the n values and print them out as required onto standard output.
Computers and Technology
1 answer:
Aleks [24]2 years ago
5 0

Answer:

/*This program is in c++*/

# include<iostream>

#include<stdio.h>

using namespace:; std;

int main()

{

 int n, a[20]; /* n can be maximum 20*/

 cout<<"Enter the value of n";

 cin>>n;

 For (int i=0;i<=n;i++)

{

  cout<<"The number must be less than"<<n;

  cin>>a[i];

}

int k=a[0];

for(int j=0;j<=n;j++)

{

   if(a[i]<k)

     {  

          a[i];=k

         k=a[i];

     }

     else

     {

          continue;

      }

}

cout<<"The numbers in ascending order are:";

for{int m=0;i<=n;i++)

{

    cout<<"a[i];

}

return 0;

}

         

Explanation:

The program is self explanatory.

You might be interested in
In order to identify the transmissions that belong to each VLAN, a switch will add a tag to Ethernet frames that identifies the
ira [324]

Answer:

True

Explanation:

Frame Tagging is a method Cisco developed to identify packets travelling through links also called VLAN Tagging.

8 0
3 years ago
How are gems and precious metals similar?
Ierofanga [76]
The answer would be d they are both rare and valuable minerals
7 0
2 years ago
Read 2 more answers
FILL IN THE BLANK.
Veseljchak [2.6K]

Answer:

It is measured in megahertz (MHz) and gigahertz (GHz).

Hope this helps.

3 0
3 years ago
Plato: A university wants to install a client-server network. Which feature do you think is important for them as they set up th
Lana71 [14]

Answer:

its sending emails and low cost to set up

Explanation:

this is how most universities work and how they do things

5 0
2 years ago
All of the following are computer hardware servicing tools EXCEPT​
andrey2020 [161]

Answer:

Shovel

Explanation:

7 0
2 years ago
Other questions:
  • JavaScript uses which property to change the current content of HTML elements?
    6·1 answer
  • Nathan took a picture of his friends while they were on a field trip. He wants upload this picture to a photo-sharing site. He w
    7·1 answer
  • Create a class 'ProblemSolution' with following characteristics A public method 'solution' without parameters and return type is
    14·1 answer
  • At the time of signing, what was the title of the man who is the first of the two names in the name of the 1901 treaty that null
    14·2 answers
  • You have purchased a printer that has the capability to print in duplex mode so that users can print on both sides of a sheet of
    7·1 answer
  • Use the Date object and the Array object to determine and diplay information about the current date on your webpage. Your output
    11·1 answer
  • List at least 5 features that can be used to format a report in word 2013
    6·1 answer
  • Describe 2 health risks posed by computers
    8·1 answer
  • Which type of app is the best choice when it is critical to be able to use the device's features but performance is not critical
    5·1 answer
  • This unintelligent brain of mine decided to charge my phone overnight thinking that nothing bad will happen ;-; the next morning
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!