joseleonweb

Untitled

Sep 21st, 2019
113
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.util.Scanner;
  2. //Un programa que llegeix un enter i el mostra per pantalla.
  3.  
  4. public class Modul {
  5.     public static void main (String[] args) {
  6.         Scanner lector = new Scanner(System.in);
  7.         //PAS 1 i 2
  8.         System.out.print("Quin és el dividend? ");
  9.         int dividend = lector.nextInt();
  10.         lector.nextLine();
  11.         //PAS 2 i 3
  12.         System.out.print("Quin és el divisor? ");
  13.         int divisor = lector.nextInt();
  14.         lector.nextLine();
  15.         //PAS 5
  16.         while (dividend >= divisor) {
  17.             //PAS 6 17 dividend = dividend − divisor;
  18.             System.out.println("Bucle: per ara el dividend val " + dividend + ".");
  19.             //PAS 7: Simplement equival a dir que fem la volta al bucle per avaluar la condició
  20.         }
  21.         System.out.println("El resultat final és " + dividend + ".");
  22.     }
  23. }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×