diff --git a/coding_freshmen/C++/Aniket_Tripathy/PRODUCT_FINDER.cpp b/coding_freshmen/C++/Aniket_Tripathy/PRODUCT_FINDER.cpp new file mode 100644 index 0000000..da18cb2 --- /dev/null +++ b/coding_freshmen/C++/Aniket_Tripathy/PRODUCT_FINDER.cpp @@ -0,0 +1,35 @@ +#include +using namespace std; + + +int main(){ + int n; + cin>>n; + int arr[n]; + for(int i=0;i> arr[i]; + } + int pivot; + cin >> pivot; + int prod = 1; + + //edge case + if(pivot==0){ + for (int i = 0; i < n;i++){ + if(arr[i]==0){ + continue; + }else{ + prod *= arr[i]; + } + } + cout << prod << endl; + exit(0); + } + + //normal case + for(int i=0;i