From 21be8043ceaefdc8efec85dfa5b5e34906780a99 Mon Sep 17 00:00:00 2001 From: Faizan Ahamed Date: Wed, 22 Apr 2020 11:11:02 +0530 Subject: [PATCH] Update searching_of_element_in_dynamic_array.cpp --- .../searching_of_element_in_dynamic_array.cpp | 30 +++++++++---------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/dynamic_programming/searching_of_element_in_dynamic_array.cpp b/dynamic_programming/searching_of_element_in_dynamic_array.cpp index 38ddc1336..9ee48dded 100644 --- a/dynamic_programming/searching_of_element_in_dynamic_array.cpp +++ b/dynamic_programming/searching_of_element_in_dynamic_array.cpp @@ -62,21 +62,19 @@ int main() { std::cin >> ac[i]; } // Change the position of Array so that new arrays entery will be done - ar[r] = ac; + ar[r] = ac; + } + // this for loop is use for display result of querry + // *** + for (z = 0; z < q; z++) { + int64_t r1 = 0, q1 = 0; + std::cout << "enter the number of row which element you want to find :"; + std::cin >> r1; + r1 = r1 - 1; + std::cout << "enter the position of element which you want to find :"; + std::cin >> q1; + q1 = q1 - 1; + // use this to find desire position of element in desire array + std::cout <<"The element is "<< ar[r1][q1] <> r1; - r1 = r1 - 1; - std::cout << "enter the position of element which you want to \ - find :"; - std::cin >> q1; - q1 = q1 - 1; - // use this to find desire position of element in desire array - std::cout <<"The element is "<< ar[r1][q1] <