Advertisement
Guest User

prueba.java

a guest
Nov 27th, 2014
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.21 KB | None | 0 0
  1. public class prueba{
  2.     public static void main(String[] args){
  3.         int n = 3;
  4.         int suma = 0;
  5.         for (int i = 1; i <= 2*n; i+=2)
  6.         {
  7.             suma = suma + (i)*(i+1)*(i+2);
  8.         }
  9.         System.out.println("Suma = "+suma);
  10.     }
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement