cesarnascimento

impares 1 a 30

May 12th, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.33 KB | None | 0 0
  1. package ex11;
  2. import java.util.Scanner;
  3.  
  4. public class ex1 {
  5.  
  6.     public static void main(String[] args) {
  7.         Scanner sc = new Scanner(System.in);
  8.         int numeros;
  9.        
  10.             for(numeros = 1; numeros <=30; numeros++){
  11.                 if(numeros % 2 != 0){
  12.                     System.out.println(numeros);
  13.                 }
  14.             }
  15.     }
  16.  
  17. }
  18. // números  ímpares  de  1  à  30
Add Comment
Please, Sign In to add comment