Akhil Sharma has Published 671 Articles

Golang program to find minimum element in array using linear search

Akhil Sharma

Akhil Sharma

Updated on 10-May-2023 11:59:28

692 Views

In this Golang article, we will learn how to find the minimum element in an array using linear search by using recursion and iterative method. An array is a collection of elements of the same data type, arranged in a contiguous block of memory, and accessed using an index or ... Read More

Golang program to return the values from the block

Akhil Sharma

Akhil Sharma

Updated on 03-May-2023 13:04:56

124 Views

In this golang article, we will learn how to return the values from the block using external function, an anonymous function. A block is created using curly braces where the scope of variables remains inside the block and not outside of it. Example 1 In this Example, two values of ... Read More

Golang program to convert milliseconds to minutes and seconds

Akhil Sharma

Akhil Sharma

Updated on 03-May-2023 13:03:39

1K+ Views

In this golang article, we will write Go language programs to convert milliseconds to minutes and seconds using various methods. Milliseconds are converted to minutes and seconds mathematically using different set of logics. Algorithm Step 1 − Import the required packages in the program Step 2 − Create a ... Read More

Golang program to create multiple BEGIN and END blocks

Akhil Sharma

Akhil Sharma

Updated on 03-May-2023 13:02:46

71 Views

In this article, we will learn to write Go language programs that will create multiple BEGIN and END blocks using curly braces, “conditional statements”, as well as “external functions”. A block is created using curly braces, the scope of a variable remains inside the block and not outside it. Algorithm ... Read More

Golang program to demonstrate BEGIN and END blocks

Akhil Sharma

Akhil Sharma

Updated on 03-May-2023 13:01:43

110 Views

In this Go language article, we will write programs to demonstrate BEGIN and END blocks using sum of numbers, iteration and two variables. Blocks are used to group the statements where the variables described in the block can only be used in that scope and not outside it. They also ... Read More

Golang program to format time in AM-PM format

Akhil Sharma

Akhil Sharma

Updated on 03-May-2023 13:01:03

690 Views

In Go language article, we will write programs to format time in AM-PM format using now and format package, as well as using now and format function with minutes and seconds. The current time can be obtained using Now function from the time package whereas we can format the time ... Read More

Golang program to display current date and time

Akhil Sharma

Akhil Sharma

Updated on 03-May-2023 12:58:46

813 Views

In Golang we can display current date and time using “now and format function”, “now function”, and “strconv package” to display the current date and time. In this article we are going to learn how to create a golang program to display current date and time using various Examples. Syntax ... Read More

Golang program to get the hash elements as a sorted array from the hash collection

Akhil Sharma

Akhil Sharma

Updated on 03-May-2023 12:54:13

212 Views

In golang we can obtain the hash elements as a sorted array from the hash collection using iteration, sort package as well as slice function. A hash collection contains a hashmap which is used to store items in the form of key value pairs. A hashmap is implemented using a ... Read More

Golang program to replace the items of hash collection from another hash collection

Akhil Sharma

Akhil Sharma

Updated on 03-May-2023 12:53:21

89 Views

In this Go language article, we learn how to replace the items of hash collection from another hash collection using ok idiom method as well as a loop to replace the items of hash collection. A hash collection contains a hashmap which is an efficient data structure Syntax func range(variable) ... Read More

Golang program to delete the item from the hash collection based on a specific key

Akhil Sharma

Akhil Sharma

Updated on 03-May-2023 12:51:24

80 Views

In this article, we will learn how tp write a Go language programs to delete the item from the hash collection based on a specified key using ok idiom method and delete keyword A hash map is a part of the hash collection. It stores the data as key value ... Read More

Advertisements