{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

MasCiclos

# MasCiclos - import java.io i import java.util p public...

This preview shows pages 1–3. Sign up to view the full content.

import java.io.*; import java.util.*; i public class MasCiclos{ p public static Scanner teclado = new Scanner(System.in); p /* Método Tabla de Multiplicar */ / public static void tablam(int n){ System.out.println(" “ Tabla de Multiplicar de "+n); for(int i=0; i<=10; i++) System.out.print(" "+n+"x"+i+"="+n*i+" |");} | /* Método que imprime los Números Intermedios */ / public static void intermedios(int n1, int n2){ System.out.println("° Números Intermedios entre "+n1+" y "+n2); if(n1<n2) for(int i=n1; i<=n2; System.out.print(i+++" ")); else for(int i=n1; i>=n2; System.out.print(i--+" "));} " /* Método que detecta Números Perfectos */ / public static void esPerfecto(int n){ int acum = 0; for(int i=1; i<n ; i++){ if(n%i==0) acum+=i;} if(acum==n) System.out.println(" ° "+n+" es un número perfecto."); else System.out.println(" ° "+n+" no es un número perfecto.");} n /* Método que detecta Números Primos */ / public static boolean esPrimo(int n){ for(int i=2; i<=(n/2); i++){ if(n%2 == 0) return false;} return true;} r /* Método de valor de e^x */ /

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
public static double factorial(int n){ double acum = 1; for(int i=1; i<=n; i++) acum = acum*i; return acum;} r
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 4

MasCiclos - import java.io i import java.util p public...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online