Chandu yadav has Published 1091 Articles

How to find and display the Multiplication Table in C#?

Chandu yadav

Chandu yadav

Updated on 22-Jun-2020 09:00:08

934 Views

To display multiplication table, you need to set the numbers and format the output property. Let’s say you want to find the table of 4 from 1 to 10. For that, set a while loop first till 10.while (a

How to read inputs as strings in C#?

Chandu yadav

Chandu yadav

Updated on 22-Jun-2020 08:55:10

9K+ Views

To read inputs as strings in C#, use the Console.ReadLine() method.str = Console.ReadLine();The above will read input as string. You don’t need to use the Convert method here since the input takes string by default.Now display the string entered by user −Example Live Demousing System; using System.Collections.Generic; class Demo { ... Read More

How MySQL evaluates if we use EXISTS operator with the subquery that returns NULL?

Chandu yadav

Chandu yadav

Updated on 22-Jun-2020 08:43:34

456 Views

If a subquery, used with EXIST operator, returns NULL, the expression EXIST NULL returns TRUE and MySQL returns the result based on an outer query. It can be understood with the help of simple example using the following data from table ‘Customers’ −mysql> Select * from Customers; +-------------+----------+ | Customer_Id | Name ... Read More

Large Fibonacci Numbers in C#

Chandu yadav

Chandu yadav

Updated on 22-Jun-2020 08:33:12

473 Views

To display large Fibonacci numbers, try the following login and code.Here, we have set the value of n as the series. Set it to get the Fibonacci number. Below, we have set it to 100 to get the first 100 Fibonacci numbers.Since the first two numbers in a Fibonacci series ... Read More

Sorting a HashMap according to keys in C#

Chandu yadav

Chandu yadav

Updated on 22-Jun-2020 08:28:50

6K+ Views

HashMap is in Java, not C#. The equivalent of HashMap in C# is Dictionary that is used as a collection of key-value pair.Firstly, set the Dictionary −Dictionary d = new Dictionary(); d.Add("soccer", 1); d.Add("cricket", 2); d.Add("tennis", 3); d.Add("rugby", 4);Now get the keys and sort them using ToList() and Sort() ... Read More

What is the difference between list and dictionary in C#?

Chandu yadav

Chandu yadav

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

6K+ Views

Dictionary is a collection of keys and values in C#. Dictionary is included in the System.Collection.Generics namespace. Dictionary is a generic type and returns an error if you try to find a key which is not there.List collection is a generic class and can store any data types to create ... Read More

How to use MySQL SOUNDEX() function with LIKE operator to retrieve the records from table?

Chandu yadav

Chandu yadav

Updated on 22-Jun-2020 07:55:56

325 Views

As we know that SOUNDEX() function is used to return the soundex, a phonetic algorithm for indexing names after English pronunciation of sound,  a string of a string. In the following example, we are taking the data from ‘student_info’ table and applying SOUNDEX() function with LIKE operator to retrieve a particular record from a table ... Read More

Retrieve data value as a pointer in C#

Chandu yadav

Chandu yadav

Updated on 22-Jun-2020 07:50:46

881 Views

A pointer is a variable whose value is the address of another variable. Retrieve the data stored at the located referenced by the pointer variable, using the ToString() method.ExampleHere in an example −using System; namespace UnsafeCodeApplication {    class Program {       public static void Main() {   ... Read More

CSS position: relative;

Chandu yadav

Chandu yadav

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

176 Views

The position: relative; property allows you to position element relative to its normal position. You can try to run the following code to implement CSS position: relative;ExampleLive Demo                    div {             position: relative;             left: 20px;             border: 3px solid blue;          }                     Positioning Element                div element with position: relative;           Output

Different ways for Integer to String Conversions in C#

Chandu yadav

Chandu yadav

Updated on 22-Jun-2020 07:39:03

16K+ Views

The easiest way to convert an integer to a string in C# is using the ToString() method.Let us see an example −int a = 100; string str = a.ToString();Another way is to use Convert.ToString();b = 50; string str2 = Convert.ToString(b); Console.WriteLine(str2);The following is the example showing the different ways to ... Read More

Advertisements