Wednesday, February 19

Program For Adding Value to Array using Java



Hi ALL,

Here I wrote a program for Adding Value to Array  Using Java.


package Arrays;



/**
 *
 * @author Balamurugan M
 */
public class Array1 {
    public static void main(String arg[]){
        int[] num=new int[5];
        for(int i=1;i<num.length;i++){
            num[i]=i+num[i-1];
           
        }
        num[0]=num[1]+num[4];
        for(int j=0; j<num.length;j++)
        System.out.println("array value "+num[j]);
       
    }  
   
}

No comments:

Post a Comment

Backup files to google drive using PHP coding

 Dear All, To backup files to Google Drive using PHP coding, you can use the Google Drive API and the Google Client Library for PHP. Here...