Commit cd54bf8d by Juan Cristaldo

Ejercicio 7 Realizado

parent f37b6958
......@@ -17,7 +17,7 @@ public class Ejercicio06 {
public static void main(String[] args) {
Scanner entrada = new Scanner(System.in);
System.out.println("***Operaciones***");
System.out.println("***Operacion del precio final con IVA***");
System.out.println("Ingrese el precio de un producto");
double precio = entrada.nextDouble();
......
/*
* 7. Muestra los números del 1 al 100 (ambos incluidos) divisibles entre 2 y 3.
*/
package javaapplication;
import java.util.Scanner;
/**
*
* @author Juan Cristaldo
*/
public class Ejercicio07 {
public static void main(String[] args) {
System.out.println("***Números divisibles entre 2***");
for (int numero = 1; numero <= 100; numero++) {
if (numero % 2 == 0)
System.out.println(" "+numero);
}
System.out.println("***Números divisibles entre 3***");
for (int numero = 1; numero <= 100; numero++) {
if (numero % 3 == 0)
System.out.println(" "+numero);
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment