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
lesantik [10]
3 years ago
9

Write a program that continually prompts the user for an integer input until input is entered that is less than 0. Each input th

at is accepted is appended to an array named inputs, until an invalid input is given. When the first invalid input is entered the program prints the array and exists.
Computers and Technology
1 answer:
professor190 [17]3 years ago
7 0

Answer:

Following are the program in the C++ Programming Language:

#include <iostream>//header file

using namespace std;//namespane

//set main method

int main() {  

int a[100]; //set integer type array variable

int value, i = 0; //set integer variables

cout<<"Enter less than 0 to exit:"<<endl; //message for exit

cout<<"Enter the integer numbers:"<<endl; //message to enter numbers

do{ //set do while

cin>>value; //get input from the user

a[i++] = value; //append elements in array

}while(value>=0);

i--;  

cout<<"\nArray are:"<<endl;//message for array

for(int k = 0;k<i;k++){ //set for loop

cout<<a[k]<<" "; //print array

}

return 0;

}

<u>Output</u>:

Enter less than 0 to exit:

Enter the integer numbers:

1

2

3

4

5

-1

Array are:

1 2 3 4 5

Explanation:

Here, we set the integer data type main method "main()" and inside it:

  • we set integer type array variable with index value 100.
  • we set two integer type variable "value" and "i" initialize value 0.
  • we set the do-while loop in which we get the input from the user and and append in the array and pass condition if the value is greater then equal to 0.
  • Finally, set for loop and print the elements of an array.

 

You might be interested in
Kaylee is part of a team preparing a long investigative report. The team asked
statuscvo [17]

Answer:content is the correct answer

Explanation:i took the test on apex

4 0
4 years ago
Read 2 more answers
Because it manages all other software the computer which software is most important
Wewaii [24]

Answer: second option: Operating system...

An operating system is the most important software that runs on a computer. It manages the computer's memory and processes, as well as all of its software and hardware. It also allows you to communicate with the computer without knowing how to speak the computer's language.

Hope this helps... Stay safe and have a Merry Christmas!!!!!!! :D

6 0
3 years ago
Read 2 more answers
The the concept of plug-and-play is demonstrated by which of the following scenarios
Vitek1552 [10]

Answer:

What are the Scenarios

I will update this when you give us them

Explanation:

5 0
3 years ago
Read 2 more answers
a network has been crashed to the point where all activities are critical. additional crashing: group of answer choices is unnec
Lunna [17]

Option D is correct. Project managers and stakeholders often use the project management technique of "crashing" to deal with emerging problems.

By allocating more resources where they are most needed, project crashing maintains or accelerates a project's scope and timeline. Crashing is a compression approach that focuses on the project timetable to hasten the project's completion date. Here are some plausible instances of crashing: Over-time. adding more resources to a particular activity. Crashing is the process of reducing the length of time it takes to complete a project by changing its scope or adding resources. Fast-tracking, which involves adjusting project activities so that they are completed in parallel and with less time spent, is typically the first option when a project's production duration needs to be shortened.

Learn more about crashing here-

brainly.com/question/4701800

#SPJ4

3 0
1 year ago
Tipos de lenguajes relacionados con c++?
Ber [7]

Answer:

Programación Java, Programación Python, Ruby

Explanation: Porque ellas son ...

3 0
3 years ago
Other questions:
  • "What is the running time of HEAPSORT on an array A of length n thatis already sorted in increasing order?
    6·1 answer
  • Which of the following statements is not true of web storage?
    13·1 answer
  • A variable like user_num can store a value like an integer. Extend the given program as indicated. Output the user's input. (2 p
    9·1 answer
  • Why did latex replace wax?
    7·1 answer
  • 2 Consider the sequence of keys (5,16,22,45,2,10,18,30,50,12,1). Draw the result of inserting entries with these keys (in the gi
    13·1 answer
  • Is Filmora 9 or Final Cut Pro Better for personal use?
    12·1 answer
  • Where is the BIOS stored?<br><br> CPU<br> CMOS<br> RAM<br> Northbridge
    13·2 answers
  • What is a feature of Print Preview
    12·2 answers
  • How can random numbers in a range be generated in Java?.
    8·1 answer
  • The objective fuction of linear progrmming should be
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!