public class Ex2 {
public static void main(String[] args) {
int[ ] a = {1,2,3,4,5,6,7,8};
a = new int [ 6 ] ;
for(int i=1 ; i<6 ; i++){
a[i] = 2*i+a[i];
System.out.println(a[i]);
i++;
}
int i=1;
while(i<6){
a[i] = 2*i+a[i];
System.out.println(a[i]);
i++;
}
System.out.print(a[ 5 ]);
}
}