java

4 different Java program to find a random value in an array

Java program to find a random value in an array in 4 different ways. We will use java.Math, java.util.Random, java.util.concurrent.ThreadLocalRandom and SecureRandom to find a random value in an array.

Read
java

Java program to check if a year is a leap year or not

How to check if a year is leap year or not in Java. We will also learn how to print all leap years in a given range of years.

Read
java

Different ways to find the factorial of a number in Java

Different Java programs to find the factorial of a number. Learn how to do it by using a for loop, while loop, do-while loop and recursively.

Read
python

Python program to extract emails from a file

Python program to extract emails from a file. It will take the file path as input and return a list of all emails found in that file.

Read
python

Python program to find duplicate words in a file

Python program to find duplicate words in a file. We will learn how to do it in two different ways, by using set and by using a dictionary.

Read
python

Read and write the content of a file backward in Python

Python program to read and write the content of a file in backward. It will read the content of a file in backward and write that content to a different file.

Read
python

Python program to sort lines of a text file alphabetically

Python program to sort the lines of a text file alphabetically. This program will sort the lines of the file in ascending order and write it to another file.

Read
c

C program to find the sum of digits of a number

C program to find the sum of digits of a given number. We will learn 3 different ways to solve it- by using a while loop, with a for loop and by using a recursive method.

Read
c

C program to find the first and the last digits of a number

C program to find the first and last digits of a number. We will learn how to do that by using a loop and with log and math functions.

Read
c

4 different ways to print the natural numbers in reverse order in C

C program to print the natural numbers in reverse order. We will learn how to do it in different ways by using a while loop, using a do-while loop, using a for loop and also how to print the natural numbers in a range.

Read