Java program to print the following pattern on the console8 Jan 2025 | 1 min read 12344321 Algorithm:
Program:Output: 12344321 123**321 12****21 1******1 Next TopicJava Programs |
In this program, we will create a singly linked list and add a new node at the middle of the list. To accomplish this task, we will calculate the size of the list and divide it by 2 to get the mid-point of the list...
7 min read
In this program, we need to calculate the sum of elements in each row and each column of the given matrix. Above diagram shows the sum of elements of each row and each column of a matrix. Algorithm STEP 1: START STEP 2: DEFINE rows, cols, sumRow, sumCol STEP 3:...
3 min read
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
In this program, we will create a doubly linked list and delete a node from the middle of the list. If the list is empty, display the message "List is empty". If the list is not empty, we will calculate the size of the list...
7 min read
It is a very interesting problem frequently asked in interviews of top IT companies like Google, Amazon, TCS, Accenture, Adobe, Apple, Infosys, 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,...
5 min read
Java Convert char to String We can convert char to String in java using String.valueOf(char) method of String class and Character.toString(char) method of Character class. Java char to String Example: String.valueOf() method Let's see the simple code to convert char to String in java using String.valueOf() method. char c='S'; String s=String.valueOf(c); Let's...
1 min read
Java Convert char to int We can convert char to int in java using various ways. If we direct assign char variable to int, it will return ASCII value of given character. If char variable contains int value, we can get the int value by calling Character.getNumericValue(char) method....
1 min read
Java Convert Decimal to Binary We can convert decimal to binary in java using Integer.toBinaryString() method or custom logic. Java Decimal to Binary conversion: Integer.toBinaryString() The Integer.toBinaryString() method converts decimal to binary string. The signature of toBinaryString() method is given below: public static String toBinaryString(int decimal) Let's see the simple example...
1 min read
In this program, we need to find the frequency of each character present in the word. Picture perfect To accomplish this task, we will maintain an array called freq with same size of the length of the string. Freq will be used to maintain the count of...
3 min read
In this program, we will find out the smallest node in the given binary tree. We first define variable min that will hold root's data. Then, we traverse through left sub-tree to find the smallest node in left subtree. Compare it with min and store...
5 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