System.out.println("find the value of c if:");
Scanner kbreader=new Scanner(System.in);
System.out.print("a="+" ");
double a=kbreader.nextDouble();
System.out.print("b=" + " ");
double b=kbreader.nextDouble();
System.out.print("c=" + " " );
System.out.print((a*a)+(b*b));
views:
171answers:
5sorry but im only 2ndyr. not very familiar with this and not so talented to do some programs. LoL/ ;) where do i put the math.sqrt? thanks in advance :)
jhoanne
2010-10-07 14:24:07
Pythagoras' formula right? `System.out.print(Math.sqrt((a*a)+(b*b)));` should work.
Prasoon Saurav
2010-10-07 14:26:19
sorry for this lil' kind of Question. :) thanks to you. maybe my code before is not complete so it makes error everytime i command to run it.i use that code also but it not works maybe i forgot to put somethine ;). thanks a lot again. God Bless ;)
jhoanne
2010-10-07 14:30:45
+5
A:
If you're going to program much in Java you'll want to get familiar with the core libraries. The Java Tutorials is a good place to start.
Bill the Lizard
2010-10-07 14:16:17
+3
A:
Look at the Math class: http://download.oracle.com/javase/6/docs/api/java/lang/Math.html
Andy White
2010-10-07 14:16:28