Advertisement
ZynThaX

Untitled

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