ARRAY PLAY USING FOR LOOP IN JAVA

  public class Main

{

public static void main(String[] args) {

    int arr[]={1,3,45,56};

    int sum = 0 ;

    for(int i=0; i<4; i++)

    {

       //System.out.println(arr[i]); 

       sum = sum+(arr[i]);

       System.out.println(sum);

    }

}

}


Comments

Popular posts from this blog

250+ C Programs for Practice

FUNCTION OVERRIDING IN CPP