code for find the determinant of 3x3 matrix

 a1=int(input("Enter R11: "))

a2=int(input("Enter R12: "))
a3=int(input("Emter R13: "))
a4=int(input("Emter R21: "))
a5=int(input("Emter R22: "))
a6=int(input("Emter R23: "))
a7=int(input("Emter R31: "))
a8=int(input("Emter R32: "))
a9=int(input("Emter R33: "))
b=(a1)*(a5*a9-a8*a6)
c=(-1)*(a2)*(a4*a9-a7*a6)
d=(a3)*(a4*a8-a7*a5)
e=b+c+d
if      a1==int(a1):
    print("The determinant of the given matrix is:",e)
elif a2==int(a2):
    print("The determinant of the given matrix is:",e)
elif a3==int(a3):
    print("The determinant of the given matrix is:",e)
elif a4==int(a4):
    print("The determinant of the given matrix is:",e)
elif a5==int(a5):
    print("The determinant of the given matrix is:",e)
elif  a6==int(a6):
    print("The determinant of the given matrix is:",e)
elif a7==int(a7):
   print("The determinant of the given matrix is:",e)
elif a8==int(a8):
      print("The determinant of the given matrix is:",e)
elif a9==int(a9):
    print("The determinant of the given matrix is:",e)
else:
     print("Enter only numeric Value.")

Comments

Popular posts from this blog

Maths Unit 1 ( Theory )

Intelligence System notes part 2