ujava saum of positive integers

Java
int num = 10, count, total = 0;

       for(count = 1; count <= num; count++){
           total = total + count;
       }
Source

Also in Java: