Akhil Sharma has Published 671 Articles

Golang program to count the elements of a slice

Akhil Sharma

Akhil Sharma

Updated on 23-Jan-2023 14:52:16

892 Views

In this article, we will learn how to count the elements of a slice using a different set of examples. A slice is a sequence of elements just like an array. An array is a fixed sequence of elements whereas a slice is a dynamic array, meaning its value is ... Read More

Golang to remove null from a slice

Akhil Sharma

Akhil Sharma

Updated on 23-Jan-2023 14:48:17

1K+ Views

In this article, we will learn how to remove a null value from a slice using a variety of examples. A slice is a sequence of elements just like an array. An array is a fixed sequence of elements whereas a slice is a dynamic array, meaning its value is ... Read More

Golang program to calculate the sum of right diagonal elements

Akhil Sharma

Akhil Sharma

Updated on 23-Jan-2023 14:44:46

154 Views

In this article, we will learn how to calculate the sum of right diagonal matrix with the help of different examples. A matrix is a 2-d array. The output will be printed on the screen using fmt.println() function which is a print statement in Golang. Algorithm Step 1 − ... Read More

Golang program to calculate the sum of left diagonal matrix

Akhil Sharma

Akhil Sharma

Updated on 23-Jan-2023 14:41:36

176 Views

In this article, we will learn how to calculate the sum of left diagonal matrix with the help of different examples. A matrix is a 2-d array. The left diagonal matrix is printed using the logic of indexes equal to each other. The output will be printed on the screen ... Read More

Golang program to print the left diagonal matrix

Akhil Sharma

Akhil Sharma

Updated on 23-Jan-2023 14:39:06

199 Views

In this article, we will see how to print the left diagonal matrix with the help of suitable examples. A matrix is a 2-d array. Here in the examples, we will use a nested for loop which will iterate through the rows and columns of the matrix to print the ... Read More

Golang program to print right diagonal matrix

Akhil Sharma

Akhil Sharma

Updated on 23-Jan-2023 14:36:40

226 Views

In this article, we will see how to print the right diagonal matrix with the help of suitable examples. A matrix is a 2-d array. Here in the examples, we will use a nested for loop which will iterate through the rows and columns of the matrix to print the ... Read More

Golang program to initialize a slice

Akhil Sharma

Akhil Sharma

Updated on 23-Jan-2023 14:34:56

2K+ Views

In this article, we will learn how to initialize a slice using a variety of ways in examples. A slice is a sequence of elements just like an array. An array is a fixed sequence of elements whereas a slice is a dynamic array, meaning its value is not fixed ... Read More

Haskell Program to read an integer number from the user

Akhil Sharma

Akhil Sharma

Updated on 23-Jan-2023 11:49:39

2K+ Views

This tutorial will help us to read an integer number from the user. The user is prompted to enter any integer number. Then the entered integer is displayed to the console. Method 1: Using read and getLine function This approach uses the read and getLine function to attempt to parse ... Read More

Haskell Program to find the 1's complement of the given number

Akhil Sharma

Akhil Sharma

Updated on 23-Jan-2023 11:37:24

201 Views

This tutorial will help us to find the 1's complement of the given number. The 1's complement of a binary number is found by inverting each bit of the number. A 1 becomes a 0, and a 0 becomes a 1. This is also known as the bitwise NOT operation. ... Read More

Haskell Program to read the height of a person and the print person is taller, dwarf, or average height person

Akhil Sharma

Akhil Sharma

Updated on 23-Jan-2023 11:31:38

83 Views

This tutorial will help us in reading the height of a person and printing if the person is taller, dwarf or average height person on being compared. The height value (in centimeters) is passed as argument to the function defined and then the height is being compared with the condition ... Read More

Advertisements