subject

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. That list is followed by two more integers representing lower and upper bounds of a range. Your program should output all integers from the list that are within that range (inclusive of the bounds). For coding simplicity, follow each output integer by a space, even the last one. The output ends with a newline. I cant figure out how to create the new line.

Ex: If the input is:

5 25 51 0 200 33
0 50
then the output is:

25 0 33
(the bounds are 0-50, so 51 and 200 are out of range and thus not output).

To achieve the above, first read the list of integers into a vector.

This is what i have so far:
#include

int main()

{

int n, min, max, i;

int arr[20];

scanf("%d",&n);

for(i=0;i
scanf("%d",&arr[i]);

}

scanf("%d",&min);

scanf("%d",&max);

for(i=0;i
if(arr[i]>=min && arr[i]<=max){

printf( "%d ", arr[i] ) ;

}

}

return 0;

}

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 12:00
Which of the following does 3d animation create an illusion of on the screen? a. depth b. emotion c. length d. dialogue
Answers: 1
question
Computers and Technology, 23.06.2019 04:00
Write a method that takes in an array of point2d objects, and then analyzes the dataset to find points that are close together. be sure to review the point2d api. in your method, if the distance between any pair of points is less than 10, display the distance and the (x,y)s of each point. for example, "the distance between (3,5) and (8,9) is 6.40312." the complete api for the point2d adt may be viewed at ~pf/sedgewick-wayne/algs4/documentation/point2d.html (links to an external site.)links to an external site.. try to write your program directly from the api - do not review the adt's source code.
Answers: 1
question
Computers and Technology, 23.06.2019 21:20
For positive constants a and b, the force between two atoms in a molecule is given f(r) = āˆ’a r2 + b r3 , where r > 0 is the distance between the atoms. note: a and b are upper case letters. (a) find f '(r) = (b) find the critical point for f(r). r = (c) find f ''(r) = (d) find the value of r so that f ''(r) = 0.
Answers: 1
question
Computers and Technology, 24.06.2019 13:30
Which of the following is not a ā€œfatal fourā€ event?
Answers: 2
You know the right answer?
Write a program that first gets a list of integers from input. The input begins with an integer indi...
Questions
question
Mathematics, 03.06.2020 13:01
question
Health, 03.06.2020 13:01
question
Mathematics, 03.06.2020 13:01
question
English, 03.06.2020 13:01
question
Mathematics, 03.06.2020 13:01