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
pashok25 [27]
3 years ago
8

Write a program that first gets a list of integers from input. Then, get another value from the input, and output all integers l

ess than or equal to that value. If the input is 5 50 60 140 200 75 100, the output is: 50 60 75.
Computers and Technology
1 answer:
jonny [76]3 years ago
5 0

Answer:

The c++ program for the given scenario is given below.

#include <iostream>

using namespace std;

int main() {

   int len=20, arr[len], data;    

   // initialize all elements of the array to 0

   for(int i=0; i<len; i++)

   {

       arr[i] = 0;

   }    

   cout<<"This program outputs all the numbers less than or equal to the given number."<<endl;

   cout<<"Enter the list of numbers. Enter 0 to stop entering the numbers. "<<endl;

   for(int i=0; i<len; i++)

   {

       cin>>arr[i];        

       // 0 indicates user wishes to stop entering values  

       if(arr[i] == 0)

           break;

       else

           continue;

   }    

   // number from which the list is to be compared

   cout<<"Enter the number to be compared."<<endl;

   cin>>data;

     

   cout<<"The values less than or equal to the number "<<data<<" are "<<endl;

   for(int i=0; i<len; i++)

   {  

       // 0 indicates the end of the list entered by the user

       if(arr[i]==0)

           break;

       if(arr[i] <= data)

           cout<<arr[i]<<endl;

   }    

   return 0;    

}  

OUTPUT

This program outputs all the numbers less than or equal to the given number.

Enter the list of numbers. Enter 0 to stop entering the numbers.  

23

45

67

89

10

0

Enter the number to be compared.

59

The values less than or equal to the number 59 are  

23

45

10

Explanation:

This program takes input only from the user and makes no assumptions.

The list of numbers entered by the user are stored in an array. If the user input is less than the size of the array, the remaining elements are set to 0.

While taking input from the user, if any element of the array is found to be 0, the loop is discontinued.

for(int i=0; i<len; i++)

   {

       cin>>arr[i];        

       if(arr[i] == 0)

           break;

       else

           continue;

   }  

Same test is applied when all the numbers less than the given number are displayed.

for(int i=0; i<len; i++)

   {  

        if(arr[i]==0)

           break;

       if(arr[i] <= data)

           cout<<arr[i]<<endl;

   }

The above program takes into account all the specifications in the given question.

You might be interested in
Why, during the final stage of the multistage model for e-commerce, is comprehensive customer information captured in the suppli
gulaghasi [49]

The reason why, in the final stage of the model for e-commerce, to captured in the supplier's database is  because it hasten customer service after an order had been delivery.

<h3>What is e-commerce?</h3>

The word electronic commerce  is often known as e-commerce. It is a term that connote a type of business model that gives room for firms and people to buy and sell goods and services using the Internet.

Note that the reason why during the final stage of the multistage model for e-commerce, a comprehensive customer information captured in the supplier's database is important because it boast or make faster customer service when an order have been delivery.

Learn more about  e-commerce from

brainly.com/question/23369154

5 0
2 years ago
We learned that an ideal multiple access protocol has FOUR desirable
Nataly [62]

Answer:

We learned that an ideal multiple access protocol has FOUR desirable

characteristics, describe them.

Explanation:

1.- Very experienced technology and easy to implement.

2.- Rigid resource management and unfit for variable traffic flows.

3.- Requires antenna duplexer for duplex transmission.

<u>Duplex</u> <em>is a term used in telecommunication to define a system that is capable of maintaining two-way communication, sending and receiving messages simultaneously. </em>

4.- Normally FDMA is combined with multiplexing FDD.

<u>FDMA</u> (acronym in English for Frequency Division Multiple Access) <em>is a multiplexing technique used in multiple communication protocols, both digital and analog, mainly radio frequency, and among them in mobile phones of GSM networks. </em>

<u>FDD</u> (Frequency Division Duplexing in English) <em>designates a duplex method in the environment of wireless telecommunications and over certain wired networks.</em>

4 0
4 years ago
What can i use to erase data off computer and what name of it and steps
swat32
Is it mac i know how
5 0
3 years ago
A _____ is an area hosted by a Web server in which project members and colleagues can share documents, models, photos, and other
pshichka [43]

Answer: Shared work-space

Explanation:

Shared work-space is one of the area that are technically hosted by the web server where all the member of the project ad also colleagues in the office can sharing the various types of documents, photos and information about the topics of status of the given project and based on the common interest.    

A shared work-space is the type of virtual and physical work space environment where the organization or company employees worked together and shared lots of information.  

 

 

4 0
3 years ago
What is company NDR?​
lina2011 [118]

Answer:

Explanation:

NDR is a multinational American based company with international branches in Thailand, Cambodia, and Myanmar in the telecom industry and media with sales of over US$100 Million. The company develops application store (APP Store) and application (APP) for mobile devices with 700,000+ apps in the app store.

7 0
3 years ago
Other questions:
  • True or False? When shooting OTS shots of two actors / subjects speaking to each other, it is best to place the camera(s) over t
    10·1 answer
  • Compare GBN, SR, and TCP (no delayed ACK). Assume that the timeout values for all three protocols are sufficiently long such tha
    7·1 answer
  • The device used to connect a network to the internet is called a
    7·1 answer
  • Heelo how do u do python syntax lesson 11 on code academy
    12·1 answer
  • Which command will display each line in the text file based on the alphabet?
    10·1 answer
  • (Help please I don't know what to choose because it's both text and email but I can only pick one. HELP!!!!!!!!!!)
    6·2 answers
  • What is the safest way to pay online​
    13·2 answers
  • Help Me Please, Ill mark whoever has the best answer with brainliest.
    14·1 answer
  • This type of headline sits next to a story.<br> Banner<br> Slammer<br> Hammer<br> Sidesaddle
    8·2 answers
  • What is the difference between functional and non-functional testing
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!