in the following code that compiles and executes I get that the number to do the sum is 0 but the sum to put the number that is if you do it correctly. Here the code:
import java.util.*;
class Args{
public static void main (String[] args){
//Atributos
int iNumero=0;
int iSumatorio=0;
int iCuenta= iNumero;
System.out.println("Introduce un número para calcular su sumatoria");
Scanner teclado = new Scanner(System.in);
iCuenta = teclado.nextInt();
while (iCuenta != 0) {
iSumatorio = iSumatorio + iCuenta;
iCuenta--;
iSumatorio--;
}
System.out.println("El sumatorio de " + iCuenta + " es " + iSumatorio);
}
}