Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class _3_21 {
- public static void main(String[] args){
- int antal;
- int max = 0;
- int tal;
- Scanner scan = new Scanner (System.in);
- System.out.print("Skriv in 5 heltal:");
- antal = scan.nextInt();
- if (antal > max){
- max = antal;
- }
- for(int i = 0; i <= 4; i++){
- System.out.print("Skriv in heltal: ");
- antal = scan.nextInt();
- }
- System.out.print("Det största talet är :" + max);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement