Chandu yadav has Published 1090 Articles

How to generate the first 100 Odd Numbers using C#?

Chandu yadav

Chandu yadav

Updated on 22-Jun-2020 07:31:12

872 Views

To generate first 100 odd numbers, set a for loop from 1 to 100.for(val = 1; val

While linking two strings, if I will add a NULL value then what would be the output of a CONCAT() function?

Chandu yadav

Chandu yadav

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

118 Views

MySQL CONCAT() function will return a NULL if you will add a NULL value while linking two strings. Following example will demonstrate it −Examplemysql> Select CONCAT('Tutorials', NULL, 'Point'); +----------------------------------+ | CONCAT('Tutorials', NULL, 'Point') | +----------------------------------+ | NULL                           ... Read More

Write a C# program to check if the entered number is Armstrong number?

Chandu yadav

Chandu yadav

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

423 Views

A number is an Armstrong number if the sum of the cube of each digit of the number is equal to the number itself.Here, we will find out the remainder and will sum it to the cube of remainder.rem = i % 10; sum = sum + rem*rem*rem;Then if the ... Read More

Why is it good to write the numbers in MySQL INTERVAL() function in ascending order?

Chandu yadav

Chandu yadav

Updated on 22-Jun-2020 06:44:25

120 Views

Actually, INTERVAL() function uses the binary search for searching the bigger number than the number at first argument. So, that is why if we want INTERVAL() function to work efficiently the list of numbers would be in ascending order. Following is a good way to use INTERVAL() function −mysql> Select ... Read More

How can we combine values of two or more columns of MySQL table and get that value in a single column?

Chandu yadav

Chandu yadav

Updated on 22-Jun-2020 06:21:50

194 Views

For combining values of two or more columns, we can use MySQL CONCAT() function. In this case, the arguments of the CONCAT() functions would be the name of the columns. For example, suppose we have a table named ‘Student’ and we want the name and address of the student collectively ... Read More

Style every element that is the child of its parent, counting from the last child with CSS

Chandu yadav

Chandu yadav

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

219 Views

Use the CSS :nth-last-child(n) selector to style every element that is the child of its parent, counting from the last child. You can try to run the following code to implement the :nth-last-child(n) selectorExampleLive Demo                    p:nth-last-child(4) {   ... Read More

How can we assign a bit value as a number to a user variable?

Chandu yadav

Chandu yadav

Updated on 22-Jun-2020 05:35:55

413 Views

As we know that the default type of a bit values assigned to user variables is binary strings but we can also assign a bit value to a number by using the following two methods −By using CAST() functionWith the help of CAST(… AS UNSIGNED) the bit value can be ... Read More

What is the difference between literal and constant in C#?

Chandu yadav

Chandu yadav

Updated on 21-Jun-2020 16:55:46

602 Views

The constants refer to fixed values that the program may not alter during its execution. These fixed values are also called literals. Constants can be of any of the basic data types like an integer constant, a floating constant, a character constant, or a string literal. There are also enumeration ... Read More

What is a non-static class in C#?

Chandu yadav

Chandu yadav

Updated on 21-Jun-2020 16:51:45

1K+ Views

Non-static classes can be instantiated, whereas static classes cannot be instantiated i.e. you cannot use the new keyword to create a variable of the class type.Non-static classes can have instance method and static methods.Access the members of a static class by using the class name itself, whereas Static class is sealed.Example of ... Read More

String format for Double in C#

Chandu yadav

Chandu yadav

Updated on 21-Jun-2020 16:35:00

2K+ Views

Use the static method String.Format for form double string format in C#.For three decimal places −String.Format("{0:0.000}", 987.383); String.Format("{0:0.000}", 987.38); String.Format("{0:0.000}", 987.7899);For thousands separator −String.Format("{0:0, 0.0}", 54567.46); String.Format("{0:0, 0}", 54567.46);To format string −Exampleusing System; class Demo {    public static void Main(String[] args) {       Console.WriteLine("Three decimal ... Read More

Advertisements