You are on page 1of 1

MEENAKSHI SUNDARARAJAN ENGINEERING COLLEGE

#363, Arcot Road, Kodambakkam, Chennai – 600024, Tamil Nadu, India

Department: Computer Science & Engineering Register No.:311521104035

PROGRAM : ( experiment 7c )

n=int(input("Enter the number of quadarples:"))


b=[list(map(str,input().split())) for i in range(n)]
ind=[]
a=[]
for i in range(n):
opr=b[i][0]
op1=b[i][1]
op2=b[i][2]
res=b[i][3]
if(opr=='+' and (op1=='0' or op2=='0') and (res==op1 or res==op2)):
ind.append(i)
elif(opr=='-' and op2=='0' and res==op1):
ind.append(i)
elif(opr=='*' and (op1=='1' or op2=='1') and (res==op1 or res==op2)):
ind.append(i)
elif(opr=='/' and op2=='1' and res==op1):
ind.append(i)
for i in range(n):
if(i not in ind):
a.append(b[i])
print("after algebraic simplification:")
for i in a:
for j in i:
print(j,end=' ')
print('',sep='\n')

OUTPUT:

Page No.:

You might also like