Advertisement
cesarnascimento

impares for 1 a 50

May 30th, 2017
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.24 KB | None | 0 0
  1. package exercicios;
  2.  
  3. public class ex9 {
  4.  
  5.     public static void main(String[] args) {
  6.         for(int i = 0;i <50; i++){
  7.             if(i % 2 != 0){
  8.             System.out.println(i);
  9.             }
  10.         }
  11.  
  12.     }
  13.  
  14. }
  15. //Programa que imprima apenas os numeros impares entre 1 e 50
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement