Buscar en el sitio

Contacto

System Zone
Hebert Arteaga
Cajamarca

949686009

blinkof.hacker@hotmail.com

Hallar numeros impares menores al ingresado.

28.06.2011 16:43

public class ejerc1 {

 

public static void main(String[] args) {

                Scanner leer = new Scanner(System.in);

        int n, r;

System.out.println("Ingrese numeros que desea:");

n=leer.nextInt();

System.out.println("Los numeros impares menores que "+n+" son: ");

for(int i=1; i<=n;i++)

{r=(2*i)-1; 

if(r<n){

System.out.print("\t"+r);}}

 

}

 

}

 
 
 

//alguna duda consulte blinkof.hacker@hotmail.com 


cell: 949686009 Cajamarca