class Calculate
{
                public static void main(String args[])
                {
                                int c=0;
                                for(int j=1;j<=10;j++)
                                                c+=j;
                                System.out.println("Sum of 10 Serial Number (1 to 10) : "+c);
                }
}

JAVA 4.PNG

Advertisements