Respuesta :
Answer:
#include <iostream>
using namespace std;
int main(){
int arr1[5], arr2[5], k = 7;
arr1 = {1,3,5,3,6}
arr2 = {1,3,2,4,4}
int reverseA2[5];
for (int x = 5; x > 0; x++){
reverseA2[5-x] = arr2[x-1];
}
for (int i = 0; i < 5; i++){
if ( arr1[i] + reverseA2[i] < k){
cout<< arr1[i] << " , "<<reverseA2[i];
}
}
}
Explanation:
The C++ source code prints a pair of values from the arr1 and reverse arr2 arrays whose sum is less than the value of the integer variable value k.
Iterating through an array requires the use of loops.
The function in C++ where comments are used to explain each line is as follows:
//This defines the function that checks for tiny pairs
void pairs(int []a,int []b,n,k){
//This iterates through the arrays; array a, in ascending order, and b in reversed order
for (int i = 0; i < n; i++){
//This checks for tiny pair
if ( a[i] + b[n-i] < k){
//If yes, the pairs are printed
cout<< a[i] << ","<<b[n-i]<<'\n';
}
}
}
Read more about loops at:
https://brainly.com/question/19344465