Ask Question
5 June, 14:25

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

+1
Answers (1)
  1. 5 June, 15:17
    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?
Find 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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers