Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package exercicios;
- import java.util.Scanner;
- public class ex7 {
- public static void main(String[] args) {
- Scanner sc = new Scanner(System.in);
- int num;
- int maior = Integer.MIN_VALUE;
- for(int i = 0;i < 5;i++){
- System.out.println("Digite o número: ");
- num = sc.nextInt();
- if(num > maior){
- maior = num;
- }
- }
- System.out.println("o maior é: "+maior);
- }
- /* César N. */
- }//faça um programa que leia 5 numeros e informe o maior
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement