Ejercicios De Algoritmo
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/package IZQUIERDO;
importjava.util.Scanner;
public class Main {
/*** @paramargs the command line arguments
*/public static void main(String[] args) {
Scanner entrada = new Scanner(System.in);
int n1;
int n2;
int n3;
int promedio=0;System.out.println("ingerese el numero1:" );
n1=entrada.nextInt();
System.out.println("ingerese el numero2:" );
n2=entrada.nextInt();
System.out.println("ingerese el numero3:" );n3=entrada.nextInt();
promedio=(n1+n2+n3)/3;
if (promedio>10.5){
System.out.printf("aprobado:" );
}
else{
System.out.printf("desaprobado:" );
}
}
EJERCICIO 2: COMPARACION MAYOR,MENOR
/** To change this template, choose Tools | Templates
* and open the template in the editor.
*/packageAplication;
importjava.util.Scanner;
public class Main {
/*** @paramargs thecommand line arguments*/
public static void main(String[] args) {
Scanner entrada = new Scanner(System.in);
int n1;
int n2;
int n3;
int mayor=0;
System.out.println("ingresenumero 1:");
n1 = entrada.nextInt();
System.out.println("ingresenumero 2: ");
n2 = entrada.nextInt();
System.out.println("ingresenumero 3: ");
n3 = entrada.nextInt();
if (n1>n2){if (n1>n3){
mayor = n1;
}
else if (n2>n3){
mayor = n2;
}
else {
mayor = n3;
}
}
System.out.printf("El mayor es:" + mayor);
}
}
EJERCICIO3:suma,resta,multiplicación,división.
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/package javaapplication7;
/**** @author */
public class JavaApplication7 {
/***@paramargs the command line arguments*/
public static void main(String[] args) {
nt suma,resta,multiplicacion,Division,n1,n2,n3,n4;
n1=14;
n2=20;
n3=15;
n4=2;
suma=n1+n2;
resta=n1-n2;...
Regístrate para leer el documento completo.