0% found this document useful (0 votes)
29 views1 page

entrada de Datos: For (I 1 I CV I++)

This Java program asks the user to input the number of values to calculate and then inputs those values from the user. It iterates through the input values, tracking the maximum, and finally outputs the largest value entered.

Uploaded by

Manuel Destroza
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views1 page

entrada de Datos: For (I 1 I CV I++)

This Java program asks the user to input the number of values to calculate and then inputs those values from the user. It iterates through the input values, tracking the maximum, and finally outputs the largest value entered.

Uploaded by

Manuel Destroza
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

import java.io.

*; public class caso3 { public static void main (String[] args) throws IOException { int cv,n,i,m=0; //ENTRADA DE DATOS BufferedReader x= new BufferedReader (new InputStreamReader(System.in)); do { System.out.print("Ingrese Cantidad de valores a calcular : > "); cv=Integer.parseInt(x.readLine()); } while(cv<0); for ( i=1; i<=cv; i++) { System.out.print("Ingrese " + i + " valor : > "); n=Integer.parseInt(x.readLine()); if(i==1) m=n; else { if(n>m) m=n; } }// fin FOR System.out.println(""); System.out.println(""); System.out.print(" El Mayor es : " + m);

} }

You might also like