You are on page 1of 3

Practical No.

# Write a program to print non prime numbers within the range.

# Roll NO: MC22F14F010.

n,m=input("Enter the start and end value").split( )

for i in range(int (n),int(m)+1):

flag=1

for j in range(2,i):

if i%j==0:

flag=0

break

if flag==0:

print(i,end=" ")

else:

print("\n all non prime number displayed")

Output :
Practical No : 2

# Write a program to swap value of two variable using bitwise operator.

# Roll No.MC22F14F010.

a=int(input("Enter the value of a"))

b=int(input("Enter thr value of b"))

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)

print("Entered Number are",a,b,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

print("Maximum of three number is",max)

print("Smallest of three number is",min)

You might also like