Potti Chandra Sekhar sai

Potti Chandra Sekhar sai

33 Articles Published

Articles by Potti Chandra Sekhar sai

Page 4 of 4

Haskell program to add binary strings

Potti Chandra Sekhar sai
Potti Chandra Sekhar sai
Updated on 27-Oct-2022 560 Views

This tutorial will discuss writing a program to add binary Strings in Haskell Programming Language. The computations in Haskell are Mathematical functions. Binary Strings represent a number in binary form but with String data type. Example: 5 is described as “0101”. Algorithmic steps Take Binary Strings as input. Implement the logic for adding binary Strings Print the resultant Binary String. Program to add Binary Strings We break the program into simpler functions Syntax Importing essential Packages/Modules import Data.Char Data.Char is a useful module for having functions to type cast Character to Integer and Integer to ...

Read More

Haskell program to display all prime numbers from 1 to n

Potti Chandra Sekhar sai
Potti Chandra Sekhar sai
Updated on 27-Oct-2022 2K+ Views

This tutorial will discuss writing a program to display all prime numbers from 1 to N in Haskell Programming Language. Haskell is a declarative, strongly typed, and functional language. The computations in Haskell are mathematical functions. A prime number is one that must have two positive factors 1 and the number itself. Example 2, 3, 5, 7, .. Note 1 is not a prime number because it has only one factor. Algorithm steps Implementing a function to check whether a number is prime. Implementing a function to generate all prime in a range. Display the prime numbers. Program to ...

Read More

Haskell Program to Check whether the input number is a Neon Number

Potti Chandra Sekhar sai
Potti Chandra Sekhar sai
Updated on 27-Oct-2022 400 Views

This tutorial will discuss writing a program to check whether the input number is a Neon Number in Haskell Programming Language. The computations in Haskell are mathematical functions. A neon Number is a number that satisfies the property: number is equal to the sum of the digits of its square. Example: 9 is a neon number because the sum of the digits of its square “81” (8+1) is equal to the number 9. In this Tutorial, we will discuss Program to check whether the number is a Neon number. Program to print neon numbers in a range in an ...

Read More
Showing 31–33 of 33 articles
« Prev 1 2 3 4 Next »
Advertisements