0 Bewertungen0% fanden dieses Dokument nützlich (0 Abstimmungen)
24 Ansichten1 Seite
This Java code prompts the user to input two numbers, stores them as variables a and b, calculates the square of a and b, adds them together, divides the result by 5, stores it as res, and prints out "C vale:" followed by the result.
This Java code prompts the user to input two numbers, stores them as variables a and b, calculates the square of a and b, adds them together, divides the result by 5, stores it as res, and prints out "C vale:" followed by the result.
This Java code prompts the user to input two numbers, stores them as variables a and b, calculates the square of a and b, adds them together, divides the result by 5, stores it as res, and prints out "C vale:" followed by the result.
double a, b, res; System.out.print("Ingrese a"); a = reader.nextInt(); System.out.print("Ingrese b"); b = reader.nextInt(); res = (((a*a)+(b*b))*1/5); System.out.println("C vale:" +res)