Ask Question
6 August, 21:53

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 # include

+4
Answers (1)
  1. 6 August, 22:28
    0
    The C program is given below. The code follows the instructions of the question. Follow both as you program for better understanding

    Explanation:

    #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;

    }
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Write a program that first gets a list of integers from input (the first integer indicates the number of integers that follow). That list ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers