MasCiclos - import java.io.*; i import java.util.*; p...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
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 */ /
Background image of page 1

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

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 10/29/2009 for the course ITC TC-1002 taught by Professor X during the Spring '09 term at ITESM.

Page1 / 4

MasCiclos - import java.io.*; i import java.util.*; p...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online