Blog

python tutorials and learn python

Created with Sketch.

Java Program to Find GCD of two Numbers

Java Program to Find GCD of two Numbers In this program, you’ll learn to find GCD of two numbers in Kotlin. This is done by using for and while loops with the help of if else statements.   The HCF or GCD of two integers is the largest integer that can exactly divide both numbers…
Read more

Java Program to Display Fibonacci Series

Java Program to Display Fibonacci Series In this program, you’ll learn to display fibonacci series in Java using for and while loops. You’ll learn to display the series upto a specific term or a number. The Fibonacci series is a series where the next term is the sum of pervious two terms. The first two…
Read more

Java Program to Generate Multiplication Table

Java Program to Generate Multiplication Table In this program, you’ll learn to generate the multiplication table of a given number. This is done by using a for and a while loop in Java.   Example 1: Generate Multiplication Table using for loop public class MultiplicationTable { public static void main(String[] args) { int num =…
Read more

Java Program to Find Factorial of a Number

Java Program to Find Factorial of a Number In this program, you’ll learn to find the factorial of a number using for and while loop in Java. The factorial of a positive number n is given by: factorial of n (n!) = 1 * 2 * 3 * 4 * … * n Example 1:…
Read more

Java Program to Calculate the Sum of Natural Numbers

Java Program to Calculate the Sum of Natural Numbers In this program, you’ll learn to calculate the sum of natural numbers using for loop and while loop in Java. The positive numbers 1, 2, 3… are known as natural numbers and its sum is the result of all numbers starting from 1 to the given…
Read more

Java Program to Check Whether a Character is Alphabet or Not

Java Program to Check Whether a Character is Alphabet or Not In this program, you’ll learn to check whether a given character is an alphabet or not. This is done using an if else statement or a ternary operator in Java. Example: Java Program to Check Alphabet using if else public class Alphabet { public…
Read more

Java Program to Check Whether a Number is Positive or Negative

Java Program: Checking Whether a Number is Positive or Negative Java, as a versatile programming language, provides a straightforward way to check whether a number is positive or negative. In this comprehensive blog post, we’ll create a Java program to perform this check, offering both an explanation and a step-by-step guide. Additionally, we’ll provide example…
Read more

Java Program to Check Leap Year

Java Program to Check Leap Year In this program, you’ll learn to check if the given year is a leap year or not. This is checked using a if else statement. A leap year is exactly divisible by 4 except for century years (years ending with 00). The century year is a leap year only…
Read more

Java Program to Find all Roots of a Quadratic Equation

Java Program to Find all Roots of a Quadratic Equation In this program, you’ll learn to find all roots of a quadratic equation and print them using format() in Java. The standard form of a quadratic equation is: ax2 + bx + c = 0, where a, b and c are real numbers and a…
Read more

Java Program to Find the Largest Among Three Numbers

Java Program to Find the Largest Among Three Numbers In this program, you’ll learn to find the largest among three numbers using if else and nested if..else statement in Java. Example 1: Find Largest Among three numbers using if..else statement public class Largest { public static void main(String[] args) { double n1 = -4.5, n2…
Read more