Found 26504 Articles for Server Side Programming

Swift Program to find the 1's complement of the given number

Ankita Saini
Updated on 08-Feb-2023 20:17:46

784 Views

1’s complement of a binary number is the invert of the given number. For example, we have a number = 10101011, so the one’s complement is 01010100. Here we using the following two methods to find one’s complement − Replacing 1s with 0s and 0s with 1s Using XOR In this article, we will learn how to write a swift program to find the 1’s complement of the given number. Method 1: Replacing 1s with 0s and 0s with 1s It is the smallest method to find ons complement of the given number. Here we simply convert the given number ... Read More

Swift Program to Convert Array to Set

Ankita Saini
Updated on 08-Feb-2023 20:19:03

9K+ Views

An array is used to store elements of the same data type in an order whereas a set is used to store distinct elements of the same data type without any definite order. To convert Array into set we use Set() initialiser. The resultant set contains the same elements as the original array but with no order and no duplicate elements. In this article, we will learn how to convert Array to Set using Swift programming language. Algorithm Step 1 − Create an array of integer type. Step 2 − Print the array. Step 3 − Convert array into ... Read More

Swift Program to check whether a given string is Heterogram or not

Ankita Saini
Updated on 08-Feb-2023 21:13:54

269 Views

Heterogram string is a string in which no alphabet occurs more than once. For example, “Sky with cloud” is a heterogram because in the string each alphabet occurred only once. Whereas “colorful balloons” is not a Heterogram because in the string some alphabet like o, u, l, etc appears more than once. Here we will execute different examples that will check whether the given string is heterogram or not using swift programming language. Algorithm Step 1 − Create a function. Step 2 − Remove the white space from the string. Step 3 − Create a separate array to ... Read More

Swift program to check if string is pangram or not

Ankita Saini
Updated on 08-Feb-2023 21:14:22

617 Views

Pangram string is a string that contains all the English alphabet. For example − String = “The quick brown fox jumps over the lazy dog” Here the string is a pangram string which contains all the alphabetical characters from a to z in it. String = “ Hello! Swati how are you?” Here the string is not a pangram string because it does not contain all the 26 alphabetical characters from a to z. In this article, we will learn how to write a swift program to check if a string is pangram or not. So to check if the ... Read More

Swift Program to check if an Array is Palindrome or not

Ankita Saini
Updated on 08-Feb-2023 20:20:39

4K+ Views

A palindrome array is an array that remains the same when its elements are reversed we can also say that the elements of a palindrome array remain the same even if we read it from backward or forward. For example, [1, 9, 10, 9, 1] is a palindrome array whereas [3, 5, 7, 8, 3, 2, 1] is not a palindrome array. In this article, we are going to learn different methods of finding whether the given array is a palindrome or not suing Swift programming language. Algorithm Step 1 − Create a function. Step 2 − Reverse the ... Read More

Swift Program to check if a given string is Keyword or not

Ankita Saini
Updated on 08-Feb-2023 20:21:51

341 Views

Keywords are reserved words used to perform some internal process or represent predefined actions. It is not allowed to use these keywords as a variable name, constant name, or identifier. Swift support approx 101 keywords. For example, ‘var’ is a keyword but ‘hey’ is not a keyword. Here, we will learn how to write a swift program to check whether a given string is a keyword. Algorithm Step 1 − Create an array of string types to store all the keywords supported by Swift. Step 2 − Create a function to check if the given string is a ... Read More

C program to implement CHECKSUM

Satish Kumar
Updated on 27-Nov-2023 11:36:40

10K+ Views

What is CHECKSUM? In computing, a checksum is a small-sized data created from a larger data set using an algorithm, with the intention that any changes made to the larger data set will result in a different checksum. Checksums are commonly used to verify the integrity of data that has been transmitted or stored, as errors or modifications in the data can cause the checksum to change. They can also be used to verify the authenticity of the data, as the checksum is often generated using a secret key known only to the sender and receiver. Why we use CHECKSUM? ... Read More

Which IDE is Used for Python Programming in Software Companies?

Tushar Sharma
Updated on 01-Feb-2023 20:52:31

742 Views

Integrated Development Environments (IDEs) are a crucial tool for software developers, and this is especially true for those working with the Python programming language. An IDE is a software application that provides a comprehensive environment for coding, debugging, and testing software. It typically includes a code editor, a compiler or interpreter, and a variety of other tools that help streamline the development process. In software companies, several popular IDEs are widely used for Python programming. Some of the most popular options include − PyCharm − This is one of the most popular IDEs for Python development, and it is ... Read More

What's the fastest way to split a text file using Python?

Tushar Sharma
Updated on 01-Feb-2023 20:51:39

38K+ Views

Splitting a text file in Python can be done in various ways, depending on the size of the file and the desired output format. In this article, we will discuss the fastest way to split a text file using Python, taking into consideration both the performance and readability of the code. split() method One of the most straightforward ways to split a text file is by using the built-in split() function in Python. Based on a specified delimiter this function splits a string into a list of substrings. For example, the following code splits a text file by newline characters ... Read More

What is the Difference Between Scala and Python?

Tushar Sharma
Updated on 01-Feb-2023 20:50:51

598 Views

Scala and Python are both powerful programming languages that are widely used for a variety of applications. They have some similarities, such as being high-level programming languages, but they also have some important differences. Whether you are a beginner or an experienced developer, this article will provide you with a comprehensive understanding of the key differences between Scala and Python and help you make an informed decision on which language to use for your next project. Factors Scala Python Syntax Scala is a statically typed language, which means that variables must be declared with a specific ... Read More

Advertisements