Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions amanroy2001/cramersrule.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package cwa;
import java.util.Scanner;
public class cramersrule {

public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc= new Scanner(System.in);
System.out.println("please enter the value of a,b,c,d,e and f");
double a=sc.nextDouble();
double b=sc.nextDouble();
double c= sc.nextDouble();
double d=sc.nextDouble();
double e= sc.nextDouble();
double f= sc.nextDouble();
if (((a*d)-(b*c))==0)
System.out.println("the equati has no solution")
;

else
{
double x=((e*d)-(b*f))/((a*d)-(b*c));
double y=((a*f)-(e*c))/((a*d)-(b*c));

System.out.println("the sol of equation is - "+x+" and "+y);

}



}

}