Java Program to Reverse a String using Recursion

Write a java program to reverse a string using recursion. In this tutorial, I am going to explain how to write a java code which reverse an input string using recursion. I have also added the video at the end of this tutorial.

For example :

Input String: Object
Output String: tcejbO

Sum of Digits of a Number using Recursion – Java Code

Write a java program to find sum of digits of a number using recursion. Given a number, Write a java code to calculate sum of digits of a number using recursion.

For example –

Input number : 123
Output : 6 (1 + 2 + 3)

Subscribe Our Tutorials

Get Latest Updates on Facebook

In my previous tutorial, I have explained how to find sum of digit of a number using iterative approach. In this tutorial, we are  going to learn how we can do it using recursion.

Find Largest of Three Numbers using Ternary Operator in Java

Write a java program to find largest of three numbers using ternary operator in java. Given a three input numbers, we have to write a java code to print largest of three numbers using ternary operator.

Suppose, if we have three numbers a, b and c. If a is greater than b and c then a is the largest of three numbers. Similarly, if b is greater than a and c then b is the largest of three numbers else c is largest.

Java Program to Find Missing Number in Array

Write a java program to find missing number in array. Given an array of n-1 integers and these integers are in the range of 1 to n. One of the integer is missing from an array. We have to write an efficient java code to find missing number from an array. An array does not contains any duplicates.