Jump to content

Descobrir o maior valor


Recommended Posts

package Ficha4;

import java.util.Scanner;

/*Escreva um programa que procure e indique o maior valor (e a respetiva
posição) de um vetor de 10 posições introduzido pelo utilizador.*/

public class exercicio2 {
public static void main (String [] args) {

	// ativar mecanismos de consola
	Scanner consola = new Scanner (System.in);

	int valor;
	int numAlunos = 10;
	int [] maiorNota = new int [numAlunos];

	for(int i = 0; i < numAlunos; i++){
	System.out.println("Introduza o " + (i+1) + "º ->");
	valor = consola.nextInt();


é provavel que haja erros!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.