Write a program that first gets a list of integers from input (the first integer indicates 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. If the input is: then the output is: (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. # include < iostream > # include < vector >

Respuesta :

Answer:

The C program is given below. The code follows the instructions of the question. Follow both as you program for better understanding

Explanation:

#include <stdio.h>

int main()

{

   int n, min, max, i;

   int arr[20];

   

   scanf("%d",&n);

   

   for(i=0;i<n;i++){

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

   }

   

   scanf("%d",&min);

   scanf("%d",&max);

   

   for(i=0;i<n;i++){

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

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

       }

   }

   

   return 0;

}