Python
Python
Python
flag=1
for j in range(2,i):
if i%j==0:
flag=0
break
if flag==0:
print(i,end=" ")
else:
Output :
Practical No : 2
# Roll No.MC22F14F010.
print("Before swapping")
print("a=",a,"b=",b)
a=a^b
b=a^b
a=a^b
print("After Swapping")
print("a=",a,"b=",b)
Output :
Practical No.1
#Program to find largest and smallest of three integer numbers without using
decision making statements.
#Roll No MC22F14F010
a,b,c=input("Enter three number: ").split()
a=int(a)
b=int(b)
c=int(c)
max=(a+b+abs(a-b))//2
max=(max+c+abs(max-c))//2
min=(a+b-abs(a-b))//2
min=(min+c-abs(min-c))//2