javascript

5 different JavaScript programs to find the average of array values

JavaScript program to find the average of array numbers. We will learn how to find it by using a for loop, while loop, for..of loop, forEach and with reduce with examples for each.

Read
javascript

Leap year program in JavaScript with example

JavaScript program to check if a year is a leap year or not. We will learn how to check for leap year by using a separate function and with HTML and JavaScript.

Read
java

Java program to print a diamond pattern with stars

Java program to print the diamond pattern with stars or any other character in different ways. We will learn how to use for loops and while loops to print the diamond pattern with user input height.

Read
java

Java program to print inverted Pyramid patterns in different ways

Java program to print Pyramid pattern in two different ways. We will learn how to use for loops and while loops to print the pattern in this post with example programs.

Read
java

Java program to print the vowels in a string

Java program to print the vowels in a string in a string in different ways. We will learn how to iterate and find the vowels, remove all duplicate characters from the string.

Read
javascript

How to print Floyd's triangle in JavaScript in 3 ways

JavaScript program to print Floyd's triangle. We will learn three different ways to print the triangle, by using for loops, while loops and with a separate function.

Read
java

Java program to round a number to n decimal places

Java program to round a number to n decimal places in 3 different ways. This post will show you 3 different ways to round a number in Java with examples.

Read
javascript

3 ways in JavaScript to print the Fibonacci series

JavaScript program to print the Fibonacci series in three different ways. This program will show you how to use for loop, while loop and recursive function to print the Fibonacci series.

Read
java

4 ways in Java to convert a decimal value to octal

Java program to convert a decimal value to octal in 4 different ways. We will learn how to use a while loop, a separate function, a for loop and Integer.toOctalString function to convert a user given decimal value to octal in different Java example programs.

Read
java

Java program to print left-aligned and right-aligned staircase patterns

Java program to print a left-aligned or right-aligned staircase pattern with user input height. It will also show how to print a real staircase pattern in Java.

Read