![NEUROPHARMACOLOGICAL](/avatars/35393.jpg)
NEUROPHARMACOLOGICAL
27.11.2019 •
Computers and Technology
Write a program that first gets a list of integers from input. the input begins with an integer indicating the number of integers that follow then, get the last value from the input, which indicates a threshold. output all integers less than or equal to that last threshold value. assume that the list will always contain less than 20 integers. ex: if the input is 5 50 60 140 200 75 100 the output is 50 60 75 the 5 indicates that there are five integers in the list, namely 50, 60, 140, 200, and 75. the 100 indicates that the program should output all integers less than or equal to 100, so the program outputs 50, 60, and 75. for coding simplicity, follow every output value by a space, including the last one. such functionality is common on sites like amazon, where a user can filter results.
Solved
Show answers
More tips
- C Computers and Internet How to Choose a Laptop: Expert Guide and Tips...
- C Computers and Internet How to Choose a Monitor?...
- H Horoscopes, Magic, Divination Where Did Tarot Cards Come From?...
- S Style and Beauty How to Make Your Lips Fuller? Ideas and Tips for Beautiful Lips...
- C Computers and Internet How to Learn to Type Fast?...
- A Art and Culture Who Said The Less We Love a Woman, the More She Likes Us ?...
- F Family and Home How to Get Rid of Your Neighbors?...
- S Society and Politics How Could Nobody Know About the Dead Mountaineers?...
- H Health and Medicine How to Cure Adenoids?...
Answers on questions: Computers and Technology
- C Computers and Technology Hi, I am a 7th grader and I was wondering if anyone had an opinion on the online education company i-Ready Curriculum. If so please go to https://forms.gle/Pnd4amjAnTv6jLY79....
- C Computers and Technology How does taking notes improve academic success? Check all that apply. It helps you retain information. It gives you all the answers to the tests. It allows you to review...
- H History Wyjaśnij pojęcie wsłowniczek historyczny? prosze po polsku...
- E English What do the sisters’ inner thoughts, following the visits in the night, reveal about the passage’s theme?...
- H History (I will award Brainliest! Please answer this before 10:45 A.M! Thank you! ) Please match the term to the correct definition. It was between Senator Hayne of South Carolina...
- H History When was the last day of 2019...
- C Chemistry How are water-based solutions formed? A. Solutions are formed when the water’s polar molecules separate the nonpolar molecules of the solute. B. Solutions are formed when...
- M Mathematics Mrs. Jones recorded the time, in minutes, she spends reading each day for two weeks. The results are shown. What is the IQR for each week? Week 1 Week 2 81 50 63 58 39...
- H History Which of the following is NOT a type of prison?...
- M Mathematics Which statements are true regarding the prism? Check all that apply...
Ответ:
The program to this question as follows:
Program:
#include<iostream> //include header file.
using namespace std; //using name space.
int main() //main function.
{
int n,i,key; //define variable.
int a[n]; //define array
cout<<"Enter size of array :"; //message.
cin>>n; //input number from user.
cout<<"Enter array elements :"; //message
for(i = 0;i<n;i++) //loop
{
cin>>a[i]; //input array elements
}
cout<<"Enter a number:"; //message
cin>>key; //input number.
for(i = 0;i<n;i++) //loop
{
if(a[i]<=key) //if block
{
cout<<a[i]<<"\n "; //print array elements
}
}
return 0;
}
Output:
Enter size of array :7
Enter array elements :5
50
50
75
100
200
140
Enter a number:100
5
50
50
75
100
Explanation:
The description of the above program as follows:
In this program first, we include a header file and define the main method in method we define variables and array that are "n, i, key and a[]". In this function, all variable data type is "integer". The variable n is used for the size of array and variable i use in the loop and the key variable is used for comparing array elements. Then we use an array that is "a[]" in the array, we use the for loop to insert elements form user input. Then we define a loop that uses a conditional statement in if block we check that array elements is less than and equal to a key variable. If this value is true so, we will print the remaining elements.Ответ: