
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 33676 Articles for Programming

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

1K+ Views
This tutorial will discuss how to write swift program to convert string type variable to boolean. Swift support various datatypes and string and bool are one of them. String is an ordered collection of characters. For example: “TutorialsPoint”, “Pinky”, etc. To create a string type variable we use String keyword. Whereas Boolean represent bool values. Bool has only two values either true or false. And to create boolean type variable we use Bool keyword. Swift does not provide any dedicated constructor (like String(), Int())to convert String into Bool. So we can convert boolean to string using any of the following ... Read More

2K+ Views
This tutorial will discuss how to write swift program to convert boolean type variable to string. Swift support various datatypes and string and bool are one of them. String is an ordered collection of characters. For example: “TutorialsPoint”, “Pinky”, etc. To create a string type variable we use String keyword. Whereas Boolean represent bool values. Bool has only two values either true or false. And to create boolean type variable we use Bool keyword. To convert bool type variable into string we uses String() function. This function convert any data type into string. Syntax Following is the syntax − String(variableName) ... Read More

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

572 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

381 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

344 Views
This tutorial will discuss how to write Swift program to convert the decimal number to binary using recursion. Decimal numbers are those numbers whose base value is 10. Decimal numbers are also known as base-10 number system which contain 10 numbers: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9. Here, the position of every digit in the decimal number has weight is a power of 10. Binary numbers are those numbers whose base value is 2. Binary numbers are also known as base-16 number system which contain only two number 1 and 0. Here, the position of every ... Read More

294 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

596 Views
This tutorial will discuss how to write swift program to print Pascal’s triangle. A pascal’s triangle is a triangular array of the binary coefficient. It is a never ending equilateral triangle which always follows the rule of adding two numbers from the above row to get the number of below row. For example, the initial number of first row is 1 so the number of 2nd row is the sum of two numbers of the 1st row that are 0+1 and 1+0, so we get [1, 1]. Now the number of 3rd rows is the sum of the two numbers ... Read More

562 Views
This tutorial will discuss how to write swift program to find the GCD of two given numbers using recursion. GCD(Greatest Common Factor) of two numbers is known as the greater positive number which is the common factor of both the given two positive numbers. GCD is also known as HCF(Highest Common Factor). GCD of two numbers cannot be negative or zero and the minimum GCD value of two numbers is always 1. For example, suppose we have two numbers: 16 and 24 So the factor of 16 = 2x2x2x2 The factor of 24 = 2x2x2x3 So, GCD(16, 24) = 2x2x2x2 ... Read More