Server Side Programming Articles

Page 1731 of 2109

Swift Program to calculate the volume and area of the Cylinder

Ankita Saini
Ankita Saini
Updated on 25-Aug-2022 524 Views

This tutorial will discuss how to write a Swift program to calculate the volume and area of the cylinder. A cylinder is a three-dimensional shape that has two identical parallel circular bases joined by a curved surface.Volume of the Cylinder The amount of space occupied by the cylinder in the three-dimensional plane is known as the volume of the cylinder. For example, we want to fill a cylindrical bottle with shampoo, so using volume we can calculate the required amount of shampoo. We can calculate the volume of the cylinder using radius and height of the cylinder. Formula Following is ...

Read More

Swift Program to calculate the sum of first N odd numbers

Ankita Saini
Ankita Saini
Updated on 25-Aug-2022 601 Views

This tutorial will discuss how to write a Swift program to find the sum of first N odd numbers.A number that is not divisible by 2 or we can say that when an odd number is divided by 2 then it leaves some remainder such type of number is known as an odd number. For example, when 2 divides by 2 leave remainder 0 whereas 3 divides by 2 leaves remainder 1. So it means 2 is even number and 3 is an odd number. List of odd numbers is: 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, ...

Read More

Swift Program to calculate the sum of first N even numbers

Ankita Saini
Ankita Saini
Updated on 25-Aug-2022 440 Views

This tutorial will discuss how to write a Swift program to calculate the sum of first N even numbers. A number that is multiple of 2 or we can say that a number that is completely divisible by 2(that means leaves no remainder) is known as even number. For example, 2, 4, 6, 8, 10, …etc. are even numbers. We can calculate the sum of the first N even number using the following formula. Formula Following is the formula for the sum of first N even numbers − Sum = N(N + 1) Below is a demonstration of the ...

Read More

Swift Program to find the hypotenuse of a right-angled triangle with sides l and b

Ankita Saini
Ankita Saini
Updated on 25-Aug-2022 522 Views

This tutorial will discuss how to write a Swift program to find the hypotenuse of a right-angled triangle with sides l and b. A triangle in which one angle is equal to 90 degrees and the sum of the other two angles is also 90 degrees then such type of triangle is known as a right-angled triangle. A right-angled triangle has three sides- base, perpendicular, and hypotenuse. We can find the relationship between these three sides using Pythagoras theorem.In a right-angled triangle, the square of the hypotenuse side(also known as the largest side of the triangle) is equal to the ...

Read More

Swift Program to calculate the area of the rhombus

Ankita Saini
Ankita Saini
Updated on 25-Aug-2022 357 Views

This tutorial will discuss how to write a Swift program to calculate the area of the rhombus. A rhombus is a closed two-dimensional figure or we can say that a rhombus is a quadrilateral whose all the sides are equal and the diagonals intersect each other at a right angle(that is 90 degrees). The area of the rhombus is known as the total space enclosed inside the boundaries of the rhombus. We can calculate the area of the rhombus using any of the following methods − Area of rhombus using diagonal Area of rhombus using base and height ...

Read More

Swift Program to calculate the area of Cube

Ankita Saini
Ankita Saini
Updated on 25-Aug-2022 404 Views

This tutorial will discuss how to write a Swift program to find the area of the cube. A cube is solid three dimensional shape with six square faces and all the sides of the cube are of equal length(that means Length = Breadth = Width). It is also known as regular hexahedron.The area of a cube is known as the total space enclosed inside the boundaries of the cube. The area of cube is of two types- Total surface area Lateral surface area Total Surface Area The total area occupied by all the six faces of the cube ...

Read More

How To Add Lifecycle Methods To a Class In ReactJS?

Huda Sameer
Huda Sameer
Updated on 23-Aug-2022 369 Views

Every component in React has a lifecycle that incorporates several phases. Programmers usually think of this lifecycle as the component’s ‘lifetime’. The components experience the following events: Mounting, Updating, Unmounting, and Error handling. Mounting refers to the procedure of adding nodes and updating requires programmers to alter and change these nodes in the DOM. Unmounting, on the other hand, removes nodes and error handling tracks your code to ensure it works and is bug-free. These occurrences can be compared to a component's birth, development, and eventual demise. You can override multiple lifecycle methods in each React lifecycle phase to execute ...

Read More

Swift Program to Find Sum of Even Fibonacci Terms Till number N

Ankita Saini
Ankita Saini
Updated on 19-Aug-2022 1K+ Views

This tutorial will discuss how to write a Swift program to find sum of even fibonacci terms till number N. A series of numbers in which every number is the sum of the two preceding numbers is known as Fibonacci series. The starting number of the Fibonacci series is 0 and 1, so the series is − 0, 1, 1, 2, 3, 5, 8, 13, 21, …… A number that is multiple of two is known as the even number. Or in other words, a number that is completely divisible by two is known as even number. For example, 2, ...

Read More

Swift Program to Find LCM of two Numbers

Ankita Saini
Ankita Saini
Updated on 18-Aug-2022 998 Views

This tutorial will discuss how to write a Swift program to find LCM of two numbers. LCM is also known as Least Common Multiple. It is used to calculate the smallest common multiple between two or more numbers. Here common multiple represents a number which is multiple of two or numbers. For example, we have two numbers 10 and 8 Factor of 10 = 2 x 5 Factor of 8 = 2 x 2 x 2 Union of both factors = 2 x 2 x 2 x 5 = 40 So the LCM of 10 and 8 is 40. This ...

Read More

Swift Program to Find GCD of two Numbers

Ankita Saini
Ankita Saini
Updated on 18-Aug-2022 1K+ Views

This tutorial will discuss how to write a Swift program to find GCD of two numbers. GCD is also known as Greatest Common Divisor or HCF(Highest common factor). GCD of two positive number is defined as the greater positive number which is the common factor of both the given two positive numbers. The value of GCD cannot be 0 or negative. The minimum value of GCD of two numbers is always 1. For example, we have two numbers 24 and 30. Factor of 24 = 2 x 2 x 2 x 3 Factor of 30 = 2 x 3 x ...

Read More
Showing 17301–17310 of 21,090 articles
Advertisements