[英]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!!!!. imprimir del 1 al 10 en整粒豆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 问题标题:如何在net bean中打印1到10并打印奇数和偶数感谢您的回答
Question Text: print 1 to 10 in neat beans also need the even and odd numbers thanks !!!!. 问题文本:用纯豆打印1到10还需要偶数和奇数,谢谢!!!!
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? esto lo quequerí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? 这是您要的吗?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.