Skip to content

Commit

Permalink
Update searching_of_element_in_dynamic_array.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
faizanahamed1414 authored Apr 22, 2020
1 parent 6a3c002 commit 21be804
Showing 1 changed file with 14 additions and 16 deletions.
30 changes: 14 additions & 16 deletions dynamic_programming/searching_of_element_in_dynamic_array.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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] <<std::endl;
}
// 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] <<std::endl;
}
}

0 comments on commit 21be804

Please sign in to comment.