-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFullpython_program2.py
More file actions
199 lines (143 loc) · 3.28 KB
/
Copy pathFullpython_program2.py
File metadata and controls
199 lines (143 loc) · 3.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
#def converter(usd_val):
# inr_val=usd_val*83
# print(usd_val,"USD=",inr_val,"INR")
#
#converter(10)
#to print the value of n to 0. (recursion)
#n=int(input("Enter the value of n "))
#def show(n):
# if(n==0):
# return
# print(n)
# show(n-1)
#
#
#
#show(n)
#
#n=int(input("Enter the value of n "))
##full function
#def calc_sum(n):
# if (n==0):
# return 0
# return calc_sum(n)*n
#
#sum = calc_sum(n)
#print(sum)
#
#recursion function
#def print_list(list, idx=0):
# if(idx==len(list)):
# return
# print(list[idx])
# print_list(list, idx+1)
#
#movies =["Deadpool","Lucy", "Maharaja", "The Martian"]
#
#print_list(movies)
#
#
#f=open("demo.txt")
#
#string= (66,77,88,99,55)
#avg = (66+77+88+99+55)/2
#print(avg)
#
#F=105
#print((F-32)/(9/5),"degree Celsius")
#C=30
#print((9/5)*C+32,"fahrenheit")
#print("Execution completed")
#summation
#fuction for summation
#a=24
#n=3
#d=4
#total= (n*(2*a+(n-1)*d))/2
#print("Summation of Ap is ", total)
#num= 4
#factorial =0
#for i in range( 1, num+1):
# factorial *=i
#
#print(f"The factorial of {num} is {factorial}")
#
#number = int(input("Enter a number: "))
#digits = sorted(set(str(number)), reverse=True)
#if len(digits) < 2:
# print("No second largest digit.")
#else:
# print("The second largest digit is:", digits[1])
#
#for num in range (300,0, -1 ) :
# if num%2==0 and num%3==0 and num%5 !=0:
# print(num)
#
#def factorial():
# number = int(input("Enter a positive integer: "))
# result = 1
# for i in range(1, number + 1):
# result *= i
# return result
#
#print("Factorial:", factorial())
#def square_root():
# number = float(input("Enter a number: "))
# return number ** 0.5
#
#print("Square root:", square_root())
#
#def find_unique_characters(s):
# unique_chars = ""
# for char in s:
# if s.count(char) == 1:
# unique_chars += char
# return unique_chars
#
#
#print(find_unique_characters("programming"))
#
#n = 5 # Number of rows
#for i in range(1, n + 1):
# # Print the increasing sequence
# for j in range(1, i + 1):
# print(j, end="")
#
# # Print the decreasing sequence
# for j in range(i - 1, 0, -1):
# print(j, end="")
#
# # Move to the next line
# print()
#
#for i in range(5):
# print(i)
#program 1 To find the vlaue of sqrt
#num = float(input('enter the number to find the sqrt '))
#num_sqrt = num ** 0.5
#print('The square root of %0.3f is %0.3f'%(num ,num_sqrt))
#program 2 to find the smallest divisor
#n= int(input('Enter the value of number to find the smallest divisor:'))
#a=[]
#for i in range(2,n+1):
# if(n%i==0):
# a.append(i)
#
#a.sort()
#print('smallest divisor is : ',a[0])
#print('Reg no. 24BCE10272')
#print('Execution Completed')
#to find the gcd oftwo number
def computeGCD(x,y):
if x>y:
small =y
else :
small =x
for i in range ( 1, small +1):
if((x%i==0)and (y%i==0)):
gcd=i
return gcd
a=60
b=48
print("The Gcd of 60 and48 is : ", end="")
print( computeGCD(60,48))