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]
3 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]3 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
You want to copy data from one cell or range to an adjacent cell or range in your spreadsheet, without using a shortcut key. Whi
astraxan [27]

How can you insert a new row into your data without disturbing an adjacent set of data on the same sheet? Highlight only the data where you'd like to insert a row. Right-click > Insert > Shift cells down.

3 0
3 years ago
Im confused sorry.. can i get help?
garik1379 [7]

1.

If-then statements are used in a program to run certain code when ideal conditions are met.

2.

Since the variable word holds the word kangaroo and the if statement is asking if the variable word is equal to KANGAROO, the else statement will run. The output will be FALSE

3.

if (90 < = x <= 100) should be rewritten as Nothing, the if statement is correct.

4.

You use an else statement when you want your code to do something if your if statement is false.

5.

if (num1 != num2)

I hope this helps!

7 0
3 years ago
Define what is a PC?
nekit [7.7K]

PC stands for Personal Computer (generic term) This definition appears very frequently and is found in the following Acronym Finder categories: Information technology (IT) and computers.

8 0
3 years ago
Read 2 more answers
The blank areas around the outside edges of a document are called the _____. a. settings b. margins c. blank space d. empty spac
nevsk [136]

I think it will be B margins

7 0
3 years ago
A carpenter sands a wooden board until it is smooth. Is this a physical or a chemical change?
exis [7]

This is a physical change. Because he is not changing what it is just its outward appearance. hope this helped.
7 0
3 years ago
Read 2 more answers
Other questions:
  • Brainliest to whoever can guess what year this corvette logo is from. Make your guesses
    11·1 answer
  • Each​ _____ in a relational database table is a unique record of something that users want to track.
    14·1 answer
  • Suppose that you have been running an unknown sorting algorithm. Out of curiosity, you once stopped the algorithm when it was pa
    8·1 answer
  • In what kind of attack can attackers make use of millions of computers under their control in an attack against a single server
    6·1 answer
  • Which of these is not part of the art director's job?
    9·2 answers
  • Which of these is an example of input?
    6·1 answer
  • An informative presentation can be used for conducting a classroom discussion.
    6·1 answer
  • Write a program which will -
    14·1 answer
  • An array name is a pointer constant because the address stored in it cannot be changed during runtime.
    8·2 answers
  • What would a good digital citizen do if he sees his classmate left her email account open on a school computer by mistake?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!