Documentos de Académico
Documentos de Profesional
Documentos de Cultura
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package convertir_numeros;
import java.util.Scanner;
/**
*
*/
public class suma {
public static void main(String[] args) {
Scanner leer=new Scanner(System.in);
String n1="";
String n2="";
System.out.println("Ingrese su numero en binario");//se pide el numero en binario
n1=leer.next();//se guarda nuestro numero 1
System.out.println("Ingrese su numero binario numero 2");//aqui se pide el segundo
numero
n2=leer.next();//guardara nuestro segundo numero
RESTA
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package convertir_numeros;
import java.util.Scanner;
/**
*
*/
public class resta {
public static void main(String[] args) {
Scanner leer=new Scanner(System.in);
String n1="";
String n2="";
System.out.println("Ingrese su numero en binario");//se pide el numero en binario
n1=leer.next();//se guarda nuestro numero 1
System.out.println("Ingrese su numero binario numero 2");//aqui se pide el segundo
numero
n2=leer.next();//guardara nuestro segundo numero
return resultado;
}
}