Akhil Sharma has Published 507 Articles

Go language Program to calculate the sum of matrix elements

Akhil Sharma

Akhil Sharma

Updated on 16-Feb-2023 18:45:05

231 Views

What is a Matrix? A matrix is a collection of numbers that are arranged in rows and columns, which is a two-dimensional array. Here we will use three examples to find the sum of elements and compare each element of the matrix for the same using the Golang program. Algorithm ... Read More

Golang Program to Show Usage of Static keyword in Class

Akhil Sharma

Akhil Sharma

Updated on 16-Feb-2023 18:34:38

2K+ Views

What is Static Keyword in Golang? The term "static" is used to describe variables, functions, and methods that have a fixed or unchanging value or behavior. In Go, the static keyword does not exist. In go we use the term "variables" to describe the memory locations where data is stored ... Read More

Golang Program to Print Boundary Elements of a Matrix

Akhil Sharma

Akhil Sharma

Updated on 16-Feb-2023 18:31:35

266 Views

What is Boundary Elements? In go programming language. the boundary elements of a matrix are the elements that are located on the outer edge of the matrix. They are located at four positions i.e the first row, the last row, the first column and at the last column. In a ... Read More

Golang Program to Sort the 2D Array Across Columns

Akhil Sharma

Akhil Sharma

Updated on 16-Feb-2023 18:24:11

2K+ Views

What is 2D array in Golang? In Go programming language, a 2D array is an array of arrays, where each element of the outer array is a simple array itself. The code to declare a 2d array of size 2 X 3 can be done by writing var array [2][3]. ... Read More

Golang Program to Convert String to an Array

Akhil Sharma

Akhil Sharma

Updated on 16-Feb-2023 18:18:48

9K+ Views

In Go Language, we have various data types to store data and the String data type is the one that is used to store a sequence of characters. The size of string variable is 1 or 8 bits. An array on the other hand is a data type that is ... Read More

Golang Program to Show Usage of Access Modifier

Akhil Sharma

Akhil Sharma

Updated on 16-Feb-2023 18:07:30

1K+ Views

In go programming language, there are two types of access modifiers i.e Exported and un-exported. Identifiers that are exported from the package in which they are specified are known as exported identifiers. They always begin with a capital letter. These are only valid in the package in which they are ... Read More

Golang Program to Convert String to Object

Akhil Sharma

Akhil Sharma

Updated on 16-Feb-2023 18:04:45

3K+ Views

In Golang program, a string is a data type that contains literals and characters whereas an object is a data type created from classes by keeping similar types of properties together. In this article, we will look at two methods by which we can convert a string to an object ... Read More

Golang Program to demonstrate the escape sequence characters

Akhil Sharma

Akhil Sharma

Updated on 13-Feb-2023 16:56:04

2K+ Views

In the go programming language, there are several types of special escape sequence characters. Usage of each one of them implements a different type of functionality. We shall discuss each one of them one by one in the upcoming examples. Example 1 In this example, we will write a go ... Read More

Golang Program to demonstrate the example to write double quotes in a string

Akhil Sharma

Akhil Sharma

Updated on 13-Feb-2023 16:49:40

2K+ Views

In Golang there are various techniques of printing double-quotes in the string. In this article, we are going to learn those techniques with various example. Syntax func Quote(s string) string Quote() function is present in strconv() package and is used to add a given string literal in double quotes. ... Read More

Golang Program to get characters from a string using the index

Akhil Sharma

Akhil Sharma

Updated on 13-Feb-2023 16:39:39

5K+ Views

In Golang, there are various methods to get characters from a string with the help of an index. In this article, we are using external functions as well as by using internal functions defined in the go language. Method 1: Using User-Defined Function In this method, the function that we ... Read More

Advertisements