Ask 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 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. 5 August, 11:32
    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 & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers