Aman Sharma has Published 69 Articles

How to get Input from the User in Golang?

Aman Sharma

Aman Sharma

Updated on 26-Aug-2022 09:46:33

6K+ Views

In this tutorial, we will see how to get the input from the user in Golang. Golang has a library that consists of an input/output function which helps in printing and taking the output. The function to take the input is Scanln(). Algorithm For Taking Integer Input with User ... Read More

How to Swap Two Numbers in Golang?

Aman Sharma

Aman Sharma

Updated on 26-Aug-2022 09:05:14

2K+ Views

In this tutorial, we will discuss swapping two numbers in Golang. We will cover two approaches: first swapping two numbers within the function and second creating a different function. Swapping two numbers within the function Algorithm STEP 1 − Defining the variables that we want to Swap. STEP 2 ... Read More

How to Display Alphabets (A to Z) using a loop in Golang?

Aman Sharma

Aman Sharma

Updated on 26-Aug-2022 08:52:35

1K+ Views

In this tutorial, we are going to print the alphabet from A to Z. The logic we are going to use to print the alphabet is ASCII values. Every symbol, alphabet, or number has a unique ASCII value using which we can print the Alphabets using a loop. ... Read More

How to add two Complex numbers in Golang?

Aman Sharma

Aman Sharma

Updated on 26-Aug-2022 08:27:53

490 Views

In this tutorial, we will learn how to declare and add complex numbers in Golang. Complex numbers are something that has an imaginary and real part which will make them different from other types of numbers. Golang supports declaring a variable of complex number type. ... Read More

How to add Two Binary Strings in Golang?

Aman Sharma

Aman Sharma

Updated on 26-Aug-2022 08:25:40

936 Views

This tutorial will show how we can add two binary strings in Golang. Also, we will cover and understand all the cases while adding two strings using examples. Example Suppose we want to add these two binary strings “111” and “1011” whose numeric values are 7 and 11 whose ... Read More

How to Multiply Two Floating-Point Numbers in Golang?

Aman Sharma

Aman Sharma

Updated on 26-Aug-2022 08:04:03

739 Views

This tutorial will show how to multiply two float numbers within a function or by creating a separate function and calling it in the current function. Multiplying two float numbers within the function Algorithm STEP 1 − Defining the floating variables that we want to multiply and the floating ... Read More

How to Add Two Numbers in Golang?

Aman Sharma

Aman Sharma

Updated on 26-Aug-2022 08:00:01

4K+ Views

In this tutorial, we will discuss adding two numbers in Golang. We will cover two approaches first adding two numbers within the function and second creating a different function. Adding two numbers within the function Algorithm STEP 1 − Defining the variables that we want to add. STEP 2 ... Read More

How to print a string in Golang?

Aman Sharma

Aman Sharma

Updated on 26-Aug-2022 07:46:44

9K+ Views

In this tutorial, we will learn how to print a string in the Golang programming language. To print a string in Golang we have to use the package fmt which contains the input/output functions. The correct specifier tells the data type of variable we are printing. The specifiers we can ... Read More

How to Print an Integer in Golang?

Aman Sharma

Aman Sharma

Updated on 26-Aug-2022 07:36:53

10K+ Views

In this tutorial, we will learn how to print an integer in the Golang Programming language. The fmt package is used to perform the input/output operations which are comparable to the input/output functions in C i.e scanf and printf. Also, format specifiers are referred from C but in Golang they ... Read More

Previous 1 ... 3 4 5 6 7
Advertisements