filmov
tv
How to Find The GCD of The Two Numbers Using Python? | Tamil | Quick Through #PythonProgramming

Показать описание
Hello Guys!
In this video,We are going to learn
How to find the GCD of the two numbers
using python.
**************************************
Problem: How to find the GCD of the two numbers?
Algorithm:
1)start the program.
2)take two number from the users.
3)when second number becomes zero return the first number.
4)else recursucie call the function with the arguments as
the second number and the remainder then the first number
is divided by the second number.
5)return the first number which is GCD of two number.
6)print the GCD.
7)stop the program.
****************************************
Source Code:
def gcd(a,b):
if (b==0):
return a
else:
return gcd(b,a%b)
a=int(input('please enter the first integer'))
b=int(input('please enter the second integer'))
GCD=gcd(a,b)
print('gcd value is :')
print(GCD)
******************************************
Keywords: how to find gcd of two numbers in tamil ,
problem solving and python programming lab programs,
anna university lab manuals , python programming
tamil , quick through python programming tamil ,
gcd of two numbers.
********************************************
Watch the video fully annd make sure to subscribe
this channel:)
In this video,We are going to learn
How to find the GCD of the two numbers
using python.
**************************************
Problem: How to find the GCD of the two numbers?
Algorithm:
1)start the program.
2)take two number from the users.
3)when second number becomes zero return the first number.
4)else recursucie call the function with the arguments as
the second number and the remainder then the first number
is divided by the second number.
5)return the first number which is GCD of two number.
6)print the GCD.
7)stop the program.
****************************************
Source Code:
def gcd(a,b):
if (b==0):
return a
else:
return gcd(b,a%b)
a=int(input('please enter the first integer'))
b=int(input('please enter the second integer'))
GCD=gcd(a,b)
print('gcd value is :')
print(GCD)
******************************************
Keywords: how to find gcd of two numbers in tamil ,
problem solving and python programming lab programs,
anna university lab manuals , python programming
tamil , quick through python programming tamil ,
gcd of two numbers.
********************************************
Watch the video fully annd make sure to subscribe
this channel:)
Комментарии