Division De Enteros Java

package javaapplication1;
import java.util.Scanner;
public class JavaApplication1 {

public static void main(String[] args) {
int dividendo = 50;
int divisor = 2;
int cociente = 0;
while (dividendo >0) {
  cociente++;
  dividendo = dividendo-divisor;
}
System.out.println("Cociente " + cociente);
System.out.println("Resto " + (-dividendo));
}
}

Share this

Related Posts

Previous
Next Post »

Buscar en Wikipedia

Resultados de la búsqueda