GoLang Program to Print Pyramid Star Pattern

Akhil Sharma
Updated on 22-Nov-2022 12:58:40

882 Views

In this tutorial we will write a Go language code to print pyramid star pattern. We will depict how you can print the pyramid star pattern. * * * * * * * * * * * * * * * * * * * * * * * * * How to print a Pyramid star pattern? A pattern is shown above, and in the pattern, you can clearly see that 2 stars is increasing with increase in ... Read More

Convert Int Type Variables to String in Go

Akhil Sharma
Updated on 22-Nov-2022 12:49:27

17K+ Views

In this tutorial we will learn how to convert int type variables to string variables using Golang programming language. A string is defined as the sequence of one or more characters (letters, numbers, or symbols). Computer applications frequently use strings as a data type thus, there is a need to convert strings to numbers or numbers to strings at manny places specially when we are using data entered by the user. Syntax func Itoa(x int) string Itoa() function in go programming language is used to get the string representation of any integer value here it is depicted by ... Read More

Convert Double Type Variables to String in Go

Akhil Sharma
Updated on 22-Nov-2022 12:21:36

872 Views

In this tutorial we will learn how to convert double(float64) type variables to string variables using Golang programming language. Double stands for double precision. In programming languages, a double data-type is used to handle decimal numbers more precisely i.e. using double data type we can store more number of digits after a decimal point with accuracy. String data type is used to store a sequence of characters. It can be in the form of literals or alphabets. The size of string variable is 1 byte or 8 bits. EXAMPLE 1: GO LANGUAGE CODE TO CONVERT DOUBLE TYPE ... Read More

Convert Double Type Variables to Int in Go

Akhil Sharma
Updated on 22-Nov-2022 12:16:02

3K+ Views

In this tutorial we will learn how to convert double type variables to integer variables using Golang programming language. Double stands for double precision. In programming languages, a double data-type is used to handle decimal numbers more precisely i.e. using double data type we can store more number of digits after a decimal point with accuracy EXAMPLE 1: GO LANGUAGE CODE TO CONVERT DOUBLE TYPE VARIABLES TO INT: Syntax fmt.Println(int(b)) Int(x) To convert a float type input ... Read More

Meaning of the Question Mark in Swift

Nitin Aggarwal
Updated on 22-Nov-2022 11:15:11

2K+ Views

In this tutorial, you will learn what is a question mark in the Swift language, how to use it, and what it is used for. What does the question mark indicate? This question mark indicates that a variable might contain a nil value or some value of type declared with the variable. Before learning what a question mark is, let's understand what are optionals in Swift. Optionals When you create a variable in the Swift language, either it can contain an initial value or it might be holding nothing at the initial point. In that ... Read More

What is Defer in Swift

Nitin Aggarwal
Updated on 22-Nov-2022 11:11:52

5K+ Views

In this tutorial, you will learn what the defer keyword is and how it can be used in Swift. You will see in what situations you can use the defer keyword. What is defer? A defer is a statement that is used for executing code just before transferring program control outside of the scope that the statement appears. The defer statement is not something you will need to use often in Swift. It will be useful in situations when you want to clean resources before they go out of scope. The defer keyword was introduced in the ... Read More

What is a Guard Statement in Swift

Nitin Aggarwal
Updated on 22-Nov-2022 11:08:23

3K+ Views

In this tutorial, you will learn about what is a guard statement and how it is implemented in the Swift language. Let's learn. What is a guard statement? In Swift, the guard is a statement that transfers control between codes like an if-else statement. The guard statement is the most commonly used statement in Swift. When certain conditions are not met to allow the flow to continue, the guard statement is used to transfer flow control. A guard statement is similar to an if statement with one major difference. The if statement runs when a certain condition ... Read More

Collection Types Available in Swift

Nitin Aggarwal
Updated on 22-Nov-2022 10:55:28

1K+ Views

In this tutorial, you will learn about all the collections available in the Swift language, such as arrays, dictionaries, and sets. Collection Types Array Set Dictionary These collections are generic in Swift, which means they can store values of any type but of the same kind. They can work with strings, ints, classes, structs, booleans, etc. You can store any kind of value in them and cannot insert the wrong type of value by mistake. If you define a string array, you cannot insert values of Int or any other type. Points to ... Read More

Lazy Stored Procedure in Swift

Nitin Aggarwal
Updated on 22-Nov-2022 10:42:43

4K+ Views

In this tutorial, you are going to learn about the lazy stored procedure. What is the lazy keyword and how to use it in Swift? Let's learn. In iOS development, it is very common to deal with complex objects. But you need to use them until it’s really needed. In Swift, there are some declaration modifiers that modify the behavior of the declaration. An example of a lazy modifier is one that is used to modify the meaning of the stored variables of a class or structure. What Swift's stored properties are? In Swift, stored ... Read More

Key Features of the Swift Programming Language

Nitin Aggarwal
Updated on 22-Nov-2022 10:37:53

2K+ Views

In this tutorial, you are about to learn about what is Swift, and what are the key features of the Swift programming language. What is the Swift language? Swift is a clean and concise programming language that is growing fast and becoming increasingly popular. Swift was initially used for iOS development but has become very popular for many other things like macOS, watchOS, and server-side development. Basically, Apple introduced the Swift language as an open-source programming language as a replacement for Objective-C, C, and C++. The Swift language was created in 2014 and released publicly in 2015 ... Read More

Advertisements