From de261c4242564f8cc2a249f51eb9a1e8d053150f Mon Sep 17 00:00:00 2001 From: agarwalgeetika2000 <39965675+agarwalgeetika2000@users.noreply.github.com> Date: Sun, 10 May 2020 00:24:49 +0530 Subject: [PATCH] 17EGICS031_ARRAY_6 --- Task 6.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 Task 6.py diff --git a/Task 6.py b/Task 6.py new file mode 100644 index 0000000..c27fa8a --- /dev/null +++ b/Task 6.py @@ -0,0 +1,15 @@ +# Given an array of size N. Find two elements from the array whose product is maximum. +n=int(input("Enter the size of array: ")) +list=[] +for i in range(n): + ele = int(input()) + list.append(ele) +a=list[0] +b=list[1] +for i in range(n): + for j in range(i+1,n): + if ( list[i]*list[j] > a*b): + a=list[i] + b=list[j] +print("Maximum Product is :" ,a*b) +