Advertisement
Nannoka

PA

Aug 8th, 2014
242
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.30 KB | None | 0 0
  1. public class Principal {
  2.  
  3.     public static void main(String[] args) {
  4.  
  5.         // an = a1 + (n+1) * r
  6.  
  7.         int ordem = 7;
  8.         int primeiro_termo = 10;
  9.         int razao = 3;
  10.         int resultado = 0;
  11.  
  12.         resultado = (primeiro_termo + (ordem - 1) * razao);
  13.  
  14.         System.out.println("resultado é: " + resultado);
  15.  
  16.     }
  17.  
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement