Java

# Logic Building Exercise in Java

The following Logic Building Exercise in Java will help you crack a coding round in a programming job selection process.

1. Find whether a number is a palindrome or it can become a palindrome by adjusting a single digit.
2. Write a program to find the cyclic sum of the digits of a number.
3. How to find the sum of array elements which occur at non-prime indexes.
4. Assume that a single character is missing in a word. Now, find the possible substrings in another string that would complete this word.
5. Write a program to display the nth number in a series. Also, generate the terms of the series up to n.
6. Compute the sum of a series.
7. Write a program to find the frequency of each digit in a number.
8. Find whether the frequency of each digit in a number is the same or not. Accordingly, display true or false.
9. Write a program to generate a code using five numbers. In order to generate the code find which of the numbers are having the same frequency for each digit. Also, find which of these numbers don’t have the same frequency for each digit. After that, separately find the sum of each set of numbers. Now the code can be generated by subtracting the second sum from the first one.
10. Find whether a number is a step number or not. A number is a step number if the difference between any two consecutive digits is either 1 or -1. Accordingly, display true or false.
11. Given a number as an input parameter, n. Now find what is its position in a Fibonacci series. Note that the position of the first term of the Fibonacci series is 1.

30+ Basic Java Programs

Java Practice Exercise

Princites

Java

Java

Java