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

preview_player
Показать описание
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:)

Рекомендации по теме
Комментарии
Автор

#PythonCodeChallenge


PROBLEM: Convert Time Format From 12Hr to 24Hr!

Example:

Input = 6 :00 PM

Output = 18 :00 Hr

Sanjay-iyzf
Автор

really worth and useful.. continue this

wizardkamalesh
Автор

Bgm remove panninga na better ahh irrukum bro!

githinkumaran
Автор

as a curiosity you can also write
def GCD(a, b):
return a if b==0 else GCD(b, a%b)

if anyone is obsessed with shortcode :))

kacpermokrzycki