Xylem and Phloem Number in Java5 May 2025 | 3 min read In this section, we will learn what is xylem and phloem number and also create Java programs to check if the given number is xylem or phloem. The xylem and phloem number program frequently asked in Java coding tests and academics. Xylem and Phloem NumberA number N will be a xylem number if the sum of its extreme (first and last) digits is equal to the sum of mean (all digits except first and last) digits. If the sum of extreme digits is not equal to the sum of mean digits, the number is called phloem number. ![]() In short, we can say that: Xylem Number Sum of extreme digits = Sum of mean digits Xylem Number Sum of extreme digits ≠ Sum of mean digits Xylem and Phloem Number Example
Steps to find Xylem and Phloem Number
Let's implement the above steps in a Java program and check if the given number is xylem or phloem. Xylem and Phloem Number Java ProgramXylemPhloemExample .java Output 1: Enter a number: 825122 The sum of extreme digits: 10 The sum of mean digits: 10 825122 is a xylem number. Output 2: Enter a number: 761312 The sum of extreme digits: 9 The sum of mean digits: 11 761312 is a phloem number. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Java program to create and display a doubly linked list
In this program, we will create a doubly linked list and print all the nodes present in the list. Doubly Linked List: Doubly Linked List is a variation of the linked list. The linked list is a linear data structure which can be described as the collection...
5 min read
Sunny Number in Java
In this section, we will learn what is sunny numbers and how to create a Java program to find the sunny numbers. We will also create a Java program to find all the sunny numbers between the specified range. Sunny Number A number is called a sunny number...
3 min read
Java Program to find maximum and minimum occurring character in a string
. In this program, we need to count each character present in the string and find out the maximum and minimum occurring character. Grass is greener on the other side In above example, character 'a' is occurred only once in the string. So, it is minimum occurring character...
5 min read
Java Program to print the duplicate elements of an array
Program to Print the Duplicate Elements of an Array | Find Duplicate Elements in an Array in Java Finding duplicate elements in an array is a commonplace programming hassle that assesses the know-how of statistics systems and algorithms. Understanding the different methods to find duplicates efficiently is...
9 min read
Java program to find the percentage of uppercase, lowercase, digits and special characters in a string
File: CharacterPercentage .java import java.text.DecimalFormat; public class CharacterPercentage { static void charPercentage(String input) { int totalChar = input.length(); int upperCase = 0; int lowerCase = 0; int digits = 0; int others = 0; for (int i = 0; i < input.length(); i++) { char ch = input.charAt(i); if (Character.isUpperCase(ch)) { upperCase++; } else if (Character.isLowerCase(ch)) { lowerCase++; } else...
1 min read
Java Program to sort the elements of an array in ascending order
In this program, we need to sort the given array in ascending order such that elements will be arranged from smallest to largest. This can be achieved through two loops. The outer loop will select an element, and inner loop allows us to compare selected...
4 min read
Strontio Number in Java
In this section, we will learn what is a strontio number and also create Java programs to check if the given number is strontio. The strontio number program frequently asked in Java coding tests and academics. Strontio Number Strontio numbers are those four digits numbers when multiplied by...
3 min read
Candy Distribution Problem in Java
It is a problem frequently asked in interviews of top IT companies like Google, Amazon, TCS, Accenture, etc. By solving the problem, one wants to check the logical ability, critical thinking, and problem-solving skill of the interviewee. So, in this section, we are going to solve...
13 min read
Keith Number in Java
In this section, we will learn what is Keith number and also create Java programs to check if the given number is Keith or not. The Keith number program frequently asked in Java coding test. Keith Number A positive n digit number X is called a Keith number...
6 min read
Java Program to separate the Individual Characters from a String
In this program, we need to separate each character from the string. CHARACTERS C H A R A C T E R S In computer science, collection of characters including spaces is called as string. To separate an individual character from the string, individual characters are accessed through...
1 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
