Escreva um programa que leia 10 números e escreva o menor valor lido. Dica: utilize o do … while

/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package br.edu.facema.lista06;

import java.util.*;

/**
*
* @author FHLC
*/
public class Questoes {

public static final Questoes q = new Questoes();
public static final Scanner s = new Scanner(System.in);

public void q15() {
double[] FHLC = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
double FHLC7 = 0;
int c = 0;
do {
System.out.printf(“%s”, “Digite o ” + (c + 1) + “º número: “);
FHLC[c] = s.nextDouble();
if (FHLC[c] < FHLC7) {
FHLC7 = FHLC[c];
}
if (c == 0) {
FHLC7 = FHLC[c];
}
} while (c++ < 9);
System.out.printf(“%s%2f\n”, “…………………….\nMenor valor lido: “, FHLC7);
}

public static void main(String[] args) {
q.q15();
}
}

Deixe uma resposta