From e454a8aac9a01bbd837c3b2f2ded4222923acde2 Mon Sep 17 00:00:00 2001 From: "QaZi\" OSaMA" Date: Tue, 18 Oct 2022 00:41:33 +0500 Subject: [PATCH] Implement Multiplication algorithm using Divide and Conquer approach to multiply any two integer numbers. --- Python/20p-0598 Usama yazdani.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 Python/20p-0598 Usama yazdani.py diff --git a/Python/20p-0598 Usama yazdani.py b/Python/20p-0598 Usama yazdani.py new file mode 100644 index 0000000..f6e6e2a --- /dev/null +++ b/Python/20p-0598 Usama yazdani.py @@ -0,0 +1,25 @@ +a=str(input("Enter the first Value : ")) #taking input from users +b=str(input("Enter the second value : ")) +result=0 # use this to storing final values +for i in range(0,len(a)): # loop 1 to get value + for j in range(0,len(b)): + val1=i #declaring value to calculate the "shift " first + val1+=1 + val2=j + val2+=1 #staring with the next index bcz first value get multiplied + while(val10: + c=c+str(0) #loop to inserting zero + counter-=1 + counter=0 + result+=int(c) #adding final result + + +print("Final result is : ", result)