Advertisement
Guest User

Untitled

a guest
Dec 1st, 2015
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class _3_21 {
  4. public static void main(String[] args){
  5. int antal;
  6. int max = 0;
  7. int tal;
  8.  
  9. Scanner scan = new Scanner (System.in);
  10. System.out.print("Skriv in 5 heltal:");
  11. antal = scan.nextInt();
  12.  
  13.  
  14. if (antal > max){
  15. max = antal;
  16. }
  17.  
  18.  
  19. for(int i = 0; i <= 4; i++){
  20. System.out.print("Skriv in heltal: ");
  21. antal = scan.nextInt();
  22. }
  23. System.out.print("Det största talet är :" + max);
  24.  
  25.  
  26. }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement