Program to print the elements of an array in reverse order17 Mar 2025 | 1 min read In this program, we need to print the elements of the array in reverse order that is; the last element should be displayed first, followed by second last element and so on. ![]() Above array in reversed order: ![]() Algorithm
Program:Output: Original array: 1 2 3 4 5 Array in reverse order: 5 4 3 2 1 Next TopicJava Programs |
. In this program, we need to find the smallest and the largest word present in the string: Hardships often prepare ordinary people for an extraordinary destiny Consider above example in which 'an' is the smallest word and 'extraordinary' is the largest word. One of the approach to...
4 min read
In this program, we need to check whether given singly linked list is a palindrome or not. A palindromic list is the one which is equivalent to the reverse of itself. The list given in the above figure is a palindrome since it is equivalent to...
7 min read
In this program, we will create a circular linked list and remove duplicate nodes from the list. We will compare a node with rest of the list and check for the duplicate. If the duplicate is found, delete the duplicate node from the list. 1->2->2->4->3 In the...
2 min read
In this section, we will learn what is a sphenic number and also create Java programs to check if the given number is sphenic or not. The sphenic number program frequently asked in Java coding tests and academics. Sphenic Number A positive integer n is called a sphenic...
4 min read
In this section, we will learn what is an emirp number and also create Java programs to check if the given number is emirp or not. The emirp number Java program frequently asked in Java coding tests to check the logic of the programmer. Emirp Number A number...
2 min read
The object is a basic building block of an OOPs language. In Java, we cannot execute any program without creating an object. There is various way to create an object in Java that we will discuss in this section, and also learn how to create...
7 min read
Java program to print the following pattern on the console Algorithm: STEP 1: START STEP 2: SET i =1.REPEAT STEP 3 to 7UNTIL i<=10. STEP 3: SET j=1.REPEAT STEP 4 and 5UNTIL j<=10. STEP 4: if(i==0 or i==10 or j==0 or j==10) then PRINT 1 else PRINT "" STEP 5: SET...
1 min read
How to Reverse a String in Java Word by Word In this section, we reverse a string in Java word by word. Example 1: Reverse a string word by word using recursion import java.util.Scanner; public class ReverseStringExample1 { public static void main(String[] args) { String str; System.out.println("Enter a string: "); Scanner scanner =...
1 min read
In this section, we will learn what is an autobiographical number and also create Java programs to check if the given number is autobiographical or not. The autobiographical number program frequently asked in Java coding tests to check the logic of the programmer. Autobiographical Number A digit count...
4 min read
Buzz number is another special number in Java that ends with digit 7 or divisible by 7. Unlike Prime and Armstrong numbers, the Buzz number is not so popular and asked by the interviewers. In simple words, a number is said to be Buzz if it ends...
3 min read
We request you to subscribe our newsletter for upcoming updates.
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India