From 591a050e7f8993d30c1b44590d7b2f2bde17575e Mon Sep 17 00:00:00 2001 From: Nathh17 Date: Mon, 3 Nov 2025 17:52:26 +0100 Subject: [PATCH 1/2] feat(verify.cpp): Added function to check if value is in Array --- exercises/verify.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/exercises/verify.cpp b/exercises/verify.cpp index 23356789..7a85093d 100644 --- a/exercises/verify.cpp +++ b/exercises/verify.cpp @@ -9,10 +9,25 @@ The number 3 is [not] present in the array. #include using namespace std; +template bool contains(const T* Arr, const size_t& dim, const T& toFind){ + for(size_t i=0; i> toFind; + + if(contains(N, 10, toFind)) + cout << "The number " << toFind << "is present in the array" << endl; + else + cout << "The number " << toFind << "is NOT present in the array" << endl; + return 0; } From 2548891afdc0a27c1a03b7a4e7db06025de85dd5 Mon Sep 17 00:00:00 2001 From: Nathh17 Date: Mon, 3 Nov 2025 17:56:44 +0100 Subject: [PATCH 2/2] fix(verify.cpp): Fixed array name in function --- exercises/verify.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/exercises/verify.cpp b/exercises/verify.cpp index 7a85093d..21379e92 100644 --- a/exercises/verify.cpp +++ b/exercises/verify.cpp @@ -11,8 +11,9 @@ using namespace std; template bool contains(const T* Arr, const size_t& dim, const T& toFind){ for(size_t i=0; i> toFind; if(contains(N, 10, toFind)) - cout << "The number " << toFind << "is present in the array" << endl; + cout << "The number " << toFind << " is present in the array" << endl; else cout << "The number " << toFind << "is NOT present in the array" << endl;