Programming Articles - Page 555 of 3363

What are the collection types that are 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

Difference between Swift and Objective-C

Nitin Aggarwal
Updated on 22-Nov-2022 10:25:07

3K+ Views

In this tutorial, you are going to understand the difference between Swift and Objective-C languages. Both languages are used for Apple development but they are different from each other, let’s understand. How does Swift differ from Objective-C? Swift is overtaking Objective-C to become the most popular language for the Apple platform. Even Apple is updating Objective-C as well. Header Files The Objective-C language is based on C, but includes OOP concepts within it. In order to use the public functions and properties of any framework, we had to import header files. Swift does away ... Read More

Golang program to find the area of a rectangle

Saumya Srivastava
Updated on 21-Nov-2022 06:56:16

890 Views

This tutorial will discuss how to find the area of a rectangle in Golang programming using two methods − Area of the rectangle using length and breadth Area of the rectangle using diagonal and breadth Rectangle A rectangle is a two-dimensional shape that has four sides. The opposite sides of a rectangle are equal and all the angles of a rectangle are at 90°. Another property of a rectangle is that its opposite sides are parallel to each other. Area of a rectangle The total space enclosed within the boundary of the rectangle is known as the area ... Read More

Golang program to calculate the volume of a cube

Saumya Srivastava
Updated on 21-Nov-2022 06:51:26

383 Views

In this tutorial, we will be discussing the approach to finding the volume of a cube in Golang programming using the sides of the cube. But before writing the code for this, let’s briefly discuss the cube and its volume. Cube A cube is a three-dimensional figure that has six square faces. All six faces of the cube are in the shape of a square. Its length, breadth, and height are equal. Dice is a common example of a cube. Volume of a cube The total three-dimensional space occupied by the cube is known as the volume of ... Read More

Golang program to calculate the volume and area of the Cylinder

Saumya Srivastava
Updated on 21-Nov-2022 06:38:05

280 Views

In this tutorial, we will be discussing the approach to calculate the volume and area of a cylinder in Golang programming using its height and radius. But before writing the code for this, let’s briefly discuss the cylinder and its volume and area. Cylinder A cylinder is a three-dimensional figure whose base has a circular shape. The distance between the two bases is known as the cylinder’s height ‘h’ and the radius of the base is denoted by ‘r’. A cold drink can is a good example of a cylinder. Volume of a cylinder The capacity ... Read More

Golang program to calculate the volume and area of a Sphere

Saumya Srivastava
Updated on 21-Nov-2022 06:33:21

329 Views

In this tutorial, we will be discussing the approach to calculate the volume and area of a sphere using its radius in Golang programming. But before writing the code for this, let’s briefly discuss the sphere and its volume and area. Sphere A sphere is a three-dimensional figure whose all points are equidistant from the center. It has no edges and no faces. The radius of the sphere is denoted by ‘r’. A ball is a good example of a sphere. Volume of a sphere The capacity or amount of space a sphere occupies is termed ... Read More

Golang program to calculate the volume and area of a Cone

Saumya Srivastava
Updated on 21-Nov-2022 06:29:08

344 Views

In this tutorial, we will be discussing the approach to calculate the volume and area of a cone using its height and radius in Golang programming. But before writing the code for this, let’s briefly discuss the cone and its volume and area. Cone A cone is a three-dimensional figure that is pointed at the top and its base is flat and curved. The height of the cone is denoted by ‘h’ and the radius of the flat curved surface is denoted by ‘r’. An ice cream cone is a good example of a cone. $$\mathrm{where\: length \, ... Read More

Golang program to calculate the sum of all odd numbers up to N

Saumya Srivastava
Updated on 21-Nov-2022 06:26:06

607 Views

In this tutorial, we will be discussing the program to find the sum of all odd numbers up to ‘N’ in Golang programming. But before writing the code for this, let’s have a brief discussion on odd numbers. Odd Numbers An odd number is a number that is not completely divisible by 2 and its remainder is always 1 when the number is divided by 2. A simple way to check whether a number is an odd number or not is to check its last digit. If the last digit is 1, 3, 5, 7, or 9, then the number ... Read More

Advertisements