Arjun Thakur has Published 1025 Articles

Infinity or Exception in C# when divide by 0?

Arjun Thakur

Arjun Thakur

Updated on 22-Jun-2020 07:43:38

2K+ Views

Divide by zero is the System.DivideByZeroException, which is a class that handles errors generated from dividing a dividend with zero.Let us see an example.Example Live Demousing System; namespace ErrorHandlingApplication {    class DivNumbers {       int result;       DivNumbers() {          result = ... Read More

Difference between prefix and postfix operators in C#?

Arjun Thakur

Arjun Thakur

Updated on 22-Jun-2020 07:35:26

7K+ Views

Prefix OperatorThe increment operator ++ if used as prefix on a variable, the value of variable gets incremented by 1. After that the value is returned unlike Postfix operator. It is called Prefix increment operator. In the same way the prefix decrement operator works but it decrements by 1.For example, an ... Read More

How can we retrieve the output having decimal values of a column in a specified format?

Arjun Thakur

Arjun Thakur

Updated on 22-Jun-2020 07:29:37

561 Views

MySQL FORMAT() function, converts a number to a format like #, ###, ###.### which is rounded up to the number of decimal places specified and returns the result as a string, can be used to retrieve the output having decimal values of a column in a specified format. To understand ... Read More

Using the new keyword in C#

Arjun Thakur

Arjun Thakur

Updated on 22-Jun-2020 07:25:22

8K+ Views

Use the new keyword to create an instance of the array. The new operator is used to create an object or instantiate an object. Here in the example an object is created for the class using the new.The following is an example.Calculate c = new Calculate();You can also use the ... Read More

What is the difference between String.Copy() and String.CopyTo() methods in C#?

Arjun Thakur

Arjun Thakur

Updated on 22-Jun-2020 07:22:38

333 Views

String.CopyTo() method gets the string characters and places them into an array. A group of characters are copied from source string into a character array.The following is the Copy() method −Example Live Demousing System; class Demo {    static void Main(String[] args) {       string str = "This ... Read More

Create a bordered list without bullets using CSS

Arjun Thakur

Arjun Thakur

Updated on 22-Jun-2020 07:21:10

300 Views

To create a bordered list without bullets, you can try to run the following code. The list-style-type is set to none to remove bullets to a listExampleLive Demo                    ul {             background-color: orange;             padding: 10px 20px;             list-style-type: none;             border: 2px solid black;          }                     Countries                India          US          Australia           Output

When MySQL IN() function returns NULL?

Arjun Thakur

Arjun Thakur

Updated on 22-Jun-2020 06:36:43

366 Views

Following are the two cases when MySQL IN() function returns NULL as result −Case-1 − When expression on  left side is NULL IN() function will return NULL if the expression on the left side is NULL. Following example will demonstrate it −mysql> Select NULL IN (1, 2, 3, 4, 10); +----------------------+ ... Read More

What is the use of IGNORE_SPACE SQL mode?

Arjun Thakur

Arjun Thakur

Updated on 22-Jun-2020 05:48:58

633 Views

The IGNORE_SPACE SQL mode can be used to modify how the parser treats function names that are whitespace-sensitive. Following are the cases in which we can use IGNORE_SPACE SQL mode −Case-1  − When IGNORE_SPACE SQL mode is disabledAfter disabling the IGNORE_SPACE SQL mode, the parser interprets the name as a ... Read More

Role of margin property with value auto using CSS

Arjun Thakur

Arjun Thakur

Updated on 22-Jun-2020 05:31:06

210 Views

The margin property with value auto is used to horizontally center the element within its container. You can try to run the following code to implement margin: auto;ExampleLive Demo                    div {             width: 200px; ... Read More

How can I customize the output of MySQL SUM() function to 0 instead of NULL when there are no matching rows?

Arjun Thakur

Arjun Thakur

Updated on 22-Jun-2020 05:20:30

293 Views

As we know that the SUM() function returns NULL if there is no matching row but sometimes we want it to return zero instead of NULL. For this purpose, we can use the MySQL COALESCE() function which accepts two arguments and returns the second argument if the first argument is ... Read More

Advertisements