A superb Pendulum array program
For other posts related to array click https://wordpress-343193-1101484.cloudwaysapps.com/array-programs-part-1-icse-computer-applications
It is an array where elements are stored in a pendulum pattern.
For other posts related to array click
Array in JAVA
// Pendulum array
import java.io.*;
class pendulumArray{
public static void main()throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
System.out.println("Enter size of array");
int size=Integer.parseInt(br.readLine());
int arr[]=new int[size];
int end=size-1;
int front=0;
System.out.println("Enter the elements");
for(int i=0;i<size;i++){
if(i%2==0){
arr[end]=Integer.parseInt(br.readLine());
end--;
}
else{
arr[front]=Integer.parseInt(br.readLine());
front++;
}
}
for(int i=0;i<size;i++){
System.out.print(arr[i]+"\t");
}
}
}
/*
INPUT: Enter size of array 5
Enter the elements 1 2 3 4 5
OUTPUT: 2 4 5 3 1
*/INPUT: Enter size of array 5
Enter the elements 1 2 3 4 5
OUTPUT: 2 4 5 3 1
To watch videos related to core java
http://www. youtube.com/user/trushntej
Related Posts
Continue learning with these related articles

Logic Gates for ISC Class 11: Truth Tables, Universal Gates, Half and Full Adder
ISC Class 11 Computer Science notes on logic gates: AND, OR, NOT, NAND, NOR, XOR and XNOR with truth tables, why NAND and NOR are universal gates, and half adder and full adder circuits with their Boolean expressions.
Decimal to Binary Conversion in Java: 3 Programs with Examples
How to convert a decimal number to binary on paper and in Java: three programs (String, place value and Integer.toBinaryString), binary to decimal, a dry run and common mistakes.

ISC Class 11 Computer Science Sample Paper 2026-27 with Solutions
A full 70-mark ISC Class 11 Computer Science sample paper for the 2026-27 annual exam: MCQs, number systems, propositional logic, logic gates, Java classes, arrays, strings, searching and sorting, and computing ethics, with complete worked solutions.