
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 1082 Articles for Go Programming

708 Views
In this tutorial, we will see to write a go language program to remove all occurrences of an element in an array. Removing occurrences from an array means that we wish to remove an entry completely from the array. Remove All Occurances Of An Element In An Array Using External Function The following code illustrates how we can remove all the occurrences of an element in an array by using a user-defined function. Algorithm Step 1 − Import the fmt package. Step 2 − Defining a function named removeOccurrence(). Step 3 − In this function, we are checking ... Read More

461 Views
In this tutorial, we will write a program to print an upper star triangle pattern in go language. In an upper star triangle pattern, there can be only one star printed in the first row and the base must be at the bottom. Printing Upper Star Triangle Pattern In Go Programming Language Algorithm Step 1 − Import the fmt package. Step 2 − Start the main function. Step 3 − In the next step, we need to initialize the integer variables viz i, j, k, and rows. The row variable contains a number of rows to be printed ... Read More

206 Views
In this article, we will write a go language program to interchange the diagonal elements of a matrix. Exchange the diagonal elements of a matrix using an external function In this program, we will write a go language program to interchange the diagonal elements of a 3 X 3 matrix using a user-defined function. Algorithm Step 1 − Import the fmt package. Step 2 − Create a function to interchange the diagonal elements of the matrix. In this function, we have defined two variables of integer type and assigned values to them. Step 3 − Use for loop ... Read More

142 Views
In this article, we will write a go language program to interchange elements of first and last row in a matrix. Interchange Elements Of The First And Last Row In A Matrix Using An External Function In this program, we will write a go language program to interchange the elements of the first and last row of a 3 X 3 matrix using an external function. Algorithm Step 1 − Import the fmt package. Step 2 − Create a function to interchange the first and last row of a matrix. In this function, we have defined two variables of ... Read More

199 Views
In this article, we will write a go language program to interchange elements of the first and last column in a matrix. Interchange Elements Of The First And Last Column In A Matrix Using An External Function In this program, we will write a go language program to interchange the elements of the first and last column of a 3 X 3 matrix using an external function. Algorithm Step 1 − Import the fmt package. Step 2 − Create a function to interchange the first and last columns of a matrix. In this function, we have defined two variables ... Read More

558 Views
In this article, we will write a go language program to find the transpose of a matrix. A matrix is a collection of numbers that are arranged in rows and columns, which is a two-dimensional array. Find The Transpose Of A Matrix The following code illustrates an example to find the transpose of a matrix. Algorithm Step 1 − Import the fmt package. Step 2 − Call the main() function. Step 3 − Initialize a 2-d array called matrixA and matrix and store elements in it. Step 4 − Print the matrices on the screen. Step ... Read More

158 Views
In this tutorial, we will write an article to find the normal and trace of a matrix. A matrix is considered normal if its square root equals the sum of the squares of each member and the trace is the total of a matrix's diagonal elements. Golang Program To Find The Normal Finding Normal of 2x2 Matrix In this example, we will see how we can find the normal of a 2 X 2 matrix. Algorithm Step 1 − First, we need to import the fmt and math package. Step 2 − Create a function to find the Normal ... Read More

912 Views
In this tutorial, we will see to write a go language program to find common elements in two arrays. Find Common Array Elements Using User-Defined Function The following code illustrates how we can find the common elements in two different arrays of strings. Algorithm Step 1 − import the fmt package. Step 2 − Define a function named intersection() that accepts the two arrays as arguments and returns the resultant array as an output to the function. Step 3 − Create an empty array of strings called out and a map called bucket. Step 4 − Use for ... Read More

1K+ Views
In this tutorial, we will see to write a go language program to copy all the elements of one array to another array. Copy All The Elements Of One Array To Another Array Using Equality Operator Let us now look at a go language code to copy all the elements of one array to another array by using equality operator. Algorithm Step 1 − Impot the fmt package that. Step 2 − Call the main() function. Step 3 − Initialize and define an array of type strings and store values to it. Step 4 − Print this ... Read More

394 Views
The product of two numbers is the result you get when you multiply them together. So 15 is the product of 3 and 5 and 22 is the product of 2 and 11 and so on. A Recursion is where a function calls itself by direct or indirect means. Every recursive function has a base case or base condition which is the final executable statement in recursion and halts further calls. Example-1: Golang Program Code to Find The Product of Two Numbers Using Recursion by Using The Direct Recursion Method Syntax Syntax for direct recursion func recursion() { ... Read More