Server Side Programming Articles

Page 1703 of 2109

C++ Program to get the subarray from an array using a specified range of indices

Arnab Chakraborty
Arnab Chakraborty
Updated on 13-Dec-2022 12K+ Views

A sequence of memory sections is used to store homogeneous data in an array, a linear sequential data structure. Similar to other data structures, an array needs to have specific qualities to insert, delete, traverse, and update elements efficiently. In C++, our arrays are static. There are also a few dynamic array structures available in C++. In this article, we will see how to get a subarray from a bigger array using starting and ending indices in C++. Understanding the concept with examples Given array A = [10, 14, 65, 85, 96, 12, 35, 74, 69] Given two indices 2 ...

Read More

C++ Program to push an array into another array

Arnab Chakraborty
Arnab Chakraborty
Updated on 13-Dec-2022 8K+ Views

A linear sequential data structure called an array is used to store homogeneous data in a series of memory regions. An array needs to have certain features to insert, delete, traverse, and update elements effectively, just like other data structures do. Our arrays in C++ are static. In addition, C++ offers a few dynamic array structures. There may be a maximum of Z elements that can be stored inside a static array. And there are currently n elements in it. In this article, we will see how to push the elements of one array inside another array in C++. Understanding ...

Read More

Swift program to get the remainder of float numbers using library function

Ankita Saini
Ankita Saini
Updated on 13-Dec-2022 389 Views

This tutorial will discuss how to write swift program to get the remainder of float numbers using library function. A number with fractional component is known as float numbers. For example, 34.5, 2.1, 0.2, etc. We can divide two float numbers with each other to find the remainder and quotient. Remainder is the value left after dividing a number by another number. Below is a demonstration of the same − Input Suppose our given input is − Num1 = 0.16 Num2 = 0.04 Output The desired output would be − Remainder = 0.0 To find the remainder of ...

Read More

Swift program to print spiral pattern

Ankita Saini
Ankita Saini
Updated on 13-Dec-2022 451 Views

This tutorial will discuss how to write swift program to print spiral pattern. Numeric pattern is a sequence of numbers which is used to develop different patterns or shapes like pyramid, rectangle, cross, etc. These numeric patterns are generally used to understand or practice the program flow controls, also they are good for logical thinking. To create a spiral pattern of numbers, we can use any of the following methods − Using nested for loop Using stride Function Below is a demonstration of the same − Input Suppose our given input is − Num = 6 Output ...

Read More

C++ Program to Access private members of a class

Arnab Chakraborty
Arnab Chakraborty
Updated on 13-Dec-2022 27K+ Views

Private members of a class are only accessed by the members of the class. This is done to preserve the object-oriented paradigm encapsulation, which ensures data and its related functions are kept in one unit and only accessible only from a member of that class. C++ has three different access specifiers to specify the visibility of the members of a class. The three access specifiers are − Public − If a member of a class has the visibility public, then the members can be accessed from any other class. Private − Class members having private visibility can be accessed from ...

Read More

Swift program to convert string to an array

Ankita Saini
Ankita Saini
Updated on 13-Dec-2022 9K+ Views

This tutorial will discuss how to write swift program to convert string to an array. String is an ordered collection of characters. For example − “TutorialsPoint”, “Pinky”, etc. To create a string type variable we use String keyword. var str : String Array is a collection of similar data types. Like any array of integer can contain only integer values, it does not accept string values. var arr = [Int] To convert string into an array we can use any of the following method. Below is a demonstration of the same − Input Suppose our given input is ...

Read More

C++ Program to Show Use of This Keyword in Class

Arnab Chakraborty
Arnab Chakraborty
Updated on 13-Dec-2022 5K+ Views

The ‘this’ keyword in C++ is very important and it is used in multiple use cases. The ‘this’ keyword or the ‘this’ pointer is used as an implicit object parameter when an object’s member function is called and refers to the invoking object. We take a look at the different use cases of the ‘this’ keyword. Syntax The ‘this’ keyword is used in the following way this->variable_name; Use Case 1: Resolving Variable Shadowing Variable shadowing is a very common use case for the ‘this’ pointer. Variable shadowing occurs when a class member variable and another parameter ...

Read More

Swift program to print hollow rectangle star pattern

Ankita Saini
Ankita Saini
Updated on 13-Dec-2022 646 Views

This tutorial will discuss how to write swift program to print hollow rectangle star pattern. Star pattern is a sequence of “*” which is used to develop different patterns or shapes like pyramid, rectangle, cross, etc. These star patterns are generally used to understand or practice the program flow controls, also they are good for logical thinking. To create a hollow rectangle star pattern we can use any of the following methods − Using nested for loop Using stride Function Below is a demonstration of the same − Input Suppose our given input is − Length = 10 ...

Read More

Swift program to print 8 star pattern

Ankita Saini
Ankita Saini
Updated on 13-Dec-2022 370 Views

This tutorial will discuss how to write swift program to 8 star pattern. Star pattern is a sequence of “*” which is used to develop different patterns or shapes like pyramid, rectangle, cross, etc. These star patterns are generally used to understand or practice the program flow controls, also they are good for logical thinking. To create a 8 star pattern we can use any of the following methods − Using nested for loop Using stride Function Below is a demonstration of the same − Input Suppose our given input is − Num = 5 Output The ...

Read More

Swift program to print Hello World!

Ankita Saini
Ankita Saini
Updated on 13-Dec-2022 447 Views

This tutorial will discuss how to write swift program to print Hello World. Hello world programs are the most basic program of any programming language. It is used to learn how we can simply print “Hello world” on the screen using Swift language. Example Hello world program The following program shows how to print hello world. import Swift // Printing hello world print("Hello World") Output Hello World Here we simply print hello world on the output screen using print() function. The syntax of Swift is quit easy and time saver. Like other languages you did not required ...

Read More
Showing 17021–17030 of 21,090 articles
Advertisements