Samual Sam has Published 2310 Articles

How to use ‘as’ operator in C#?

Samual Sam

Samual Sam

Updated on 20-Jun-2020 09:57:12

338 Views

The "as" operator perform conversions between compatible types. It is like a cast operation and it performs only reference conversions, nullable conversions, and boxing conversions. The as operator can't perform other conversions, such as user-defined conversions, which should instead be performed by using cast expressions.The following is an example showing ... Read More

Write a C# program to check if a number is divisible by 2

Samual Sam

Samual Sam

Updated on 20-Jun-2020 09:54:42

2K+ Views

To check if a number is divisible by2 or not, you need to first find the remainder.If the remainder of the number when it is divided by 2 is 0, then it would be divisible by 2.Let’s say our number is 10, we will check it using the following if-else ... Read More

Classes vs Structures in C#

Samual Sam

Samual Sam

Updated on 20-Jun-2020 09:26:22

699 Views

In C#, a structure is a value type data type. It helps you to make a single variable hold related data of various data types. The struct keyword is used for creating a structure.When you define a class, you define a blueprint for a data type.The following are the differences ... Read More

Comments in C#

Samual Sam

Samual Sam

Updated on 20-Jun-2020 09:13:35

282 Views

Comments are used for explaining the code. Compilers ignore the comment entries. The multiline comments in C# programs start with /* and terminate with the characters */ as shown below.Multi-line comments/* The following is a multi-line comment In C# /*The /*...*/ is ignored by the compiler and it is put ... Read More

Write a C# program to check if a number is Palindrome or not

Samual Sam

Samual Sam

Updated on 20-Jun-2020 09:11:43

1K+ Views

First, find the reverse of the string to check if a string is a palindrome or not −Array.reverse()Now use the equals() method to match the original string with the reversed. If the result is true, that would mean the string is Palindrome.Let us try the complete example. Here, our string ... Read More

Remove all duplicates from a given string in Python

Samual Sam

Samual Sam

Updated on 20-Jun-2020 09:10:40

758 Views

To remove all duplicates from a string in python, we need to first split the string by spaces so that we have each word in an array. Then there are multiple ways to remove duplicates.We can remove duplicates by first converting all words to lowercase, then sorting them and finally ... Read More

What happens with the output of MySQL EXPORT_SET() function if I will skip the value of the fifth argument i.e. a number of bits?

Samual Sam

Samual Sam

Updated on 20-Jun-2020 09:08:37

93 Views

Actually, the default value of the fifth argument i.e. number of bits is 64, hence if we will not specify any value on fifth argument them MySQL will check the bits up to 64 bits and produce the result. It can be understood from the following example −Examplemysql> SELECT EXPORT_SET(5, ... Read More

Map function and Lambda expression in Python to replace characters

Samual Sam

Samual Sam

Updated on 20-Jun-2020 09:08:20

657 Views

We want to replace a character a1 with a character a2 and a2 with a1. For example, For the input string, "puporials toinp"and characters p and t, we want the end string to look like −"tutorials point"For this we can use map function and lambdas to make the replacement. The ... Read More

How MySQL CONCAT() function, applied to the column/s of a table, can be combined with the column/s of other tables?

Samual Sam

Samual Sam

Updated on 20-Jun-2020 08:29:24

140 Views

We can use the output of CONCAT() function which is applied to the column/s of a MySQL with the column/s of another MySQL table. It can be done with the help of MySQL join.ExampleFor example, we have two table ‘Student’, having the details like id, Name, Last_name, Address and Subjects ... Read More

Fiber Optic Communications

Samual Sam

Samual Sam

Updated on 20-Jun-2020 08:23:46

3K+ Views

In fiber optic communication, data is transmitted from the source to the destination by sending light pulses through optical fibers. It changes electrical pulses to light signals and vice versa for communication. Fiber optic communications are preferred when a huge amount of data needs to be transmitted across large distances.The ... Read More

Advertisements