-1

Hi guys

Please i need help ?

Maxint: Write a program that gets two
integers from the user and prints out the
maximum value in a nice sentence beginning
“The max is: “

public class Maxint  {
	public static void main (String [] args) {
	
	System.out.println("Enter two integers");
	
	double Max = Math.Max;
	double Max = Math.Max;
		
	Max = a;
	Max = b;
	
	
		System.out.println("The max is:" + Math.Max(a,b));
	}
}
5
Contributors
9
Replies
10
Views
5 Years
Discussion Span
Last Post by jackbauer24
0

Perhaps you should actually ask a question.

i don't what to do
Plz help me to get this right

0

Well, you should probably start by referring to your class notes on how to get a value from the user.

-1

Well, you should probably start by referring to your class notes on how to get a value from the user.

ok plz explain to me how to get a value from the user !

0

If you don't have any notes from class on how to do it, then look up the Scanner class in the Java API docs.

0

If you don't have any notes from class on how to do it, then look up the Scanner class in the Java API docs.

not helping,anyway thanks

0

also, taking a look at java syntax and 'stuff' might help you out figuring out why your code won't compile.

1. don't declare two times the same variable
2. don't use the values a or b unless you actually have variables a and b with a value.

0

WHY DID YOU NAME TWO VARIABLES WITH THE SAME NAME?

double Max = Math.Max;
	double Max = Math.Max;
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.