Question 8: Java program to find number of words in String? Question 9: Write a program to find factorial of number? Question 10: Write a program to print fibonacci series? In this tutorial, we will see Java interview programs for logic building. These java programs will help students to ...
How to write a Java program to find the square root of a number is a common Java programming exercise that many institutes use in their Java course along withJava program to print Fibonacci seriesandHow to find Armstrong numbers in Java, which we have seen earlier.Java program for the squar...
On the other hand, Heap memory is the portion that was not allocated to the java program but it will be available for use by the java program when it is required, mostly during the runtime of the program. Java Utilizes this memory as - When we write a java program then all the ...
/*Java program for Factorial - to find Factorial of a Number.*/ import java.util.*; public class Factorial { public static void main(String args[]) { int num; long factorial; Scanner bf = new Scanner(System.in); //input an integer number System.out.print("Enter any integer number: ...
// Java program to find the sum of digits of a number // using the recursion import java.util.*; public class Main { static int sum = 0; public static int sumOfDigits(int num) { if (num > 0) { sum += (num % 10); sumOfDigits(num / 10); } return sum; } public static ...
Java Program to Check Whether a Number is a Palindrome or Not Java Program to Find the Factorial of a Number Java Program to Reverse a Number Java Program to search an element in a Linked List Program to convert ArrayList to LinkedList in Java ...
Write a Java program to find LCM of a given two numbers.LCM stands for Lowest Common Multiple. LCM of a two given number a and b is the smallest positive integer that is divisible by both a and b.For example the LCM of 4 and 6 is 12. Following is the java program to find LCM ...
In Java How to Check if Number/String is Palindrome or not? Write Java Program to Print Fibonacci Series up-to N Number [4 different ways] In Java How to Find Maximum Occurrence of Words from Text File? How to check if Number is Odd or Even in Java?Java...
Java Program to calculate power of a number Java Strings Programs Java Program to Convert char to String and String to Char Java Program to find duplicate characters in a String Java Program to check Palindrome String using Stack, Queue, For and While loop ...
# Python program to find the factorial of a number using recursion def recur_factorial(n): """Function to return the factorial of a number using recursion""" if n == 1: return n else: return n*recur_factorial(n-1) # take input from the user num = int(input("Enter a number: "...