How do I print 1 to 10 in netbeans and print odd and even numbers?
imprimir del 1 al 10 en neat beans tambien necesito los numeros pares y impares gracias!!!!.
Spanish to English Translation
Question Title: how to print 1 to 10 in net beans and 开发者_开发知识库print odd and even numbers thanks for your answers
Question Text: print 1 to 10 in neat beans also need the even and odd numbers thanks !!!!.
En Espanol:
// recorrer todos los números del 1 al 10
for(int i=0; i <=10; i++){
if( i%2 == 0 ) // modulo prueba por pares o impares
System.out.println ( i + " es pares");
else
System.out.println ( i + " es impares");
}
¿Es esto lo que querías?
In English:
// loop through all the numbers 1 to 10
for(int i=0; i <=10; i++){
if( i%2 == 0 ) // modulo test for even or odd
System.out.println ( i + " is even");
else
System.out.println ( i + " is odd");
}
Is this what you're asking for?
精彩评论