Last active
June 21, 2019 00:01
-
-
Save bossiernesto/b6f4eb4726e04fc402093548cb07c600 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package a; | |
| import java.util.Scanner; | |
| public class Main { | |
| public final static double pi = 3.14; | |
| public static void main(String[] args) { | |
| int diametro; | |
| double perimetro; | |
| int perimetroInt; | |
| Scanner entrada = new Scanner (System.in); | |
| System.out.println("Ingrese diámetro de círculo"); | |
| diametro=entrada.nextInt(); | |
| perimetro=(int)(pi*diametro); //ESTÁ BIEN EL CASTING? Si | |
| perimetroInt = (int) perimetro; //Otra opcion | |
| System.out.println("El perímetro del círculo es: " + perimetroInt); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment