Convert Decimal to Octal in Haskell

Akhil Sharma
Updated on 06-Apr-2023 10:44:56

250 Views

We can convert the Decimal number to an Octal using the recursion and unfoldr function of Haskell. Decimal to octal conversion is a process of converting a decimal (base-10) number to its equivalent representation in octal (base-8) numbering system. In decimal numbering system, we use 10 digits (0 to 9) to represent a number. In octal numbering system, we use 8 digits (0 to 7) to represent a number. To convert a decimal number to its equivalent octal representation, we divide the decimal number by 8 repeatedly until the quotient becomes 0, and keep track of the remainders. The remainders, ... Read More

Haskell Program to Print Half Diamond Star Pattern

Akhil Sharma
Updated on 06-Apr-2023 10:43:33

161 Views

We can create a half-diamond star pattern in Haskell using recursive and replicate functions. The half-diamond star pattern is a pattern made up of asterisks (*) arranged in the shape of a half-diamond. It is typically created by printing a series of asterisks in a pyramid shape, starting with a single asterisk in the first row, two asterisks in the second row, and so on, until the middle row which contains the maximum number of asterisks. From that row onwards, the number of asterisks decreases until there is only a single asterisk in the last row. Algorithm Step 1 ... Read More

Haskell Program to Print Hollow Right Triangle Star Pattern

Akhil Sharma
Updated on 06-Apr-2023 10:41:38

253 Views

In Haskell we can use the replicate function and recursive function to create a hollow right triangle star pattern. A hollow right triangle star pattern is a pattern made up of asterisks (*) that forms a right triangle shape with empty spaces in the middle as shown below. ** * * * * * * * * * * * * ******** The shape is created by printing asterisks in a specific order, with the number of asterisks in each row increasing as the ... Read More

Haskell Program to Print 8 Star Pattern

Akhil Sharma
Updated on 06-Apr-2023 10:39:42

173 Views

In this tutorial, we are going to learn how to develop a Haskell program to print 8 start patterns using the internal replicate and concat function. An '8' star pattern is an ASCII art representation of the number 8 using asterisks. as shown below − ******** * * * * ******** * * * * ******** The asterisks are arranged in such a way that they form the shape of the number 8. Algorithm Step 1 − ... Read More

Haskell Program to Create Pyramid ' and ' Pattern

Akhil Sharma
Updated on 06-Apr-2023 10:38:51

217 Views

In this tutorial, we are going to understand how to develop a Haskell program that will create a pyramid pattern of ‘&’ using mapM, forM, and recursive function. A pyramid ‘&’ pattern is a design or arrangement of ‘&’ or other symbols in the shape of a pyramid as shown below. & &&& &&&&& &&&&&&& &&&&&&&&& It is created by printing ‘&’ or symbols in multiple rows, starting from the top and moving downwards. Each row contains one more symbol than the previous row, creating the illusion of ... Read More

Haskell Program to Print Square Star Pattern

Akhil Sharma
Updated on 06-Apr-2023 10:36:54

430 Views

In Haskell we can use internal functions like mapM, forM or recursive functions to print square star pattern. A square star pattern is a two-dimensional pattern made up of stars (or asterisks, represented by the '*' symbol) arranged in the shape of a square as shown below. **** **** **** **** The square pattern is formed by printing a specified number of lines, each containing a specified number of stars. The pattern can be of any size, with the number of lines and the number of stars in each line determining the overall size of the square pattern. Algorithm ... Read More

Print Star Pascal's Triangle in Haskell

Akhil Sharma
Updated on 06-Apr-2023 10:35:15

516 Views

In Haskell we can use mapM function and forM function to print a star Pascal’s Triangle. A star Pascal's triangle is a variation of the traditional Pascal's triangle that uses asterisks (or stars) instead of numbers to form a triangular pattern as shown below. * * * * * * * * * Pascal's triangle is a triangular array of numbers, where each number in the triangle is the sum of the two numbers above it. In ... Read More

Print Mirror Upper Star Triangle Pattern in Haskell

Akhil Sharma
Updated on 06-Apr-2023 10:32:04

197 Views

In this article, we are going to learn how we can develop a haskell program to print mirror upper start triangle patterns using mapM function, and unliness functions. A mirror upper star triangle pattern is a pattern made up of stars (asterisks) that form a triangle shape, with the top of the triangle pointing upwards. The following star pattern will give you a better understanding of mirror upper start triangle pattern. * *** ***** ******* ********* The pattern is called "mirror" because the left and right sides of the ... Read More

Print Upper Star Triangle Pattern in Haskell

Akhil Sharma
Updated on 06-Apr-2023 10:29:57

181 Views

This tutorial will help us in printing the upper star triangle pattern using mapM function, forM function, and unliness functions in Haskell. An upper star triangle pattern is a graphical representation of a triangle made up of asterisks or stars as shown below. * ** *** **** ***** It's called an "upper" star triangle because the triangle starts at the top and the number of stars in each row decreases as we move down the triangle. Algorithm Step 1 − We will start with defining a user-defined function as printStars function. Step 2 − Program execution will be ... Read More

User Authentication in Java

Pranay Arora
Updated on 06-Apr-2023 10:18:43

2K+ Views

Authentication refers to the process of verifying the identity of an individual to make sure the user is exactly who they are claiming to be before giving access to a system. It is very important to authenticate a user to ensure the security as well as integrity of the system. Over the course of time, authentication has developed into much more advanced and secure methods. The methods of authentication now range from credentials like user id, password and OTP to finger print scan, face ID scan and much more. Authentication ensures that no sensitive resources are being shared with unauthorised ... Read More

Advertisements