+ All Categories
Home > Documents > programas en java

programas en java

Date post: 05-Sep-2015
Category:
Upload: rosveron
View: 17 times
Download: 0 times
Share this document with a friend
Description:
java
29
>> ARITMETICA << - Hallar A+B-C+100 Código: class JavaAritmetica1 { public static void main (String mago []) { int A, B, C; System.out.print ("Inserte A: "); A = Leer.datoInt (); System.out.print ("Inserte B: "); B = Leer.datoInt (); System.out.print ("Inserte C: "); C = Leer.datoInt (); System.out.println ("\n" + A + " + " + " " + B + " - " + C + " + " + 100 + " = " + (A + B - C + 100)); } } Hallar (a-b)(a+b) Código: class JavaAritmetica2 { public static void main (String elMago []) { int a, b; System.out.print ("Inserte valor a: "); a = Leer.datoInt (); System.out.print ("Inserte valor b: "); b = Leer.datoInt (); System.out.println ("(" + a + "-" + b + ") " + "(" + a + "+" + b + ") " + "= " + ((a - b) * (a + b))); } } Leer un numeo de tres digitos y sumarlos Código: class JavaAritmetica3 { public static void main (String elMago []) { int numero, sumDig = 0; System.out.print ("Inserte numero de tres digitos: "); numero = Leer.datoInt ();
Transcript

>> ARITMETICA > SERIES

Recommended