- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Ankith Reddy has Published 1070 Articles
Ankith Reddy
257 Views
Create a tuple.var myTuple = Tuple.Create(1, 2.5M, "Amit", "100");Now to access tuple elements, use the properties.To access first element.myTuple.Item1To access second element.myTuple.Item2In the same way, for other elements, use the properties as shown below −Example Live Demousing System; public class Program { public static void Main() { ... Read More
Ankith Reddy
142 Views
Use the Math.BigMul() method to find the product of two 32-bit numbers.The following are our two numbers.int one = 345272828; int two = 887685744;Now, get the product.long res; res = Math.BigMul(one, two);Example Live Demousing System; using System.Globalization; class Demo { static void Main() { int one = ... Read More
Ankith Reddy
140 Views
Use the Convert.ToUInt64() method to convert a specified value to a 64-bit unsigned integer.The following is our char.char ch = 'a';Now, let’s convert it to a 64-bit unsigned integer.ulong res; res = Convert.ToUInt64(ch);Here is the complete example.Example Live Demousing System; public class Demo { public static void Main() { ... Read More
Ankith Reddy
203 Views
Firstly, set a Dictionary collection with elements.Dictionary d = new Dictionary() { {1, "Applianes"}, {2, "Clothing"}, {3, "Toys"}, {4, "Footwear"}, {5, "Accessories"} };Now, let’s say you need to check whether key 5 exists or not. For that, use ContainsKey() method. It returns True if key ... Read More
Ankith Reddy
1K+ Views
To get the Upperbound and Lowerbound, use the GetUpperBound() GetLowerBound() methods in C#, respectively.The parameter to be set under these methods is the dimensions i.e.Let’s say our 3D array is −int[, , ] arr = new int[2, 3, 4];For a three-dimensional arrays, dimension 0.arr.GetUpperBound(0) arr.GetLowerBound(0)For a three-dimensional arrays, dimension 1.arr.GetUpperBound(1) ... Read More
Ankith Reddy
282 Views
Byte represents an 8-bit unsigned integer.Implicit conversion of an 8-bit unsigned integer (Byte) to a Decimal is possible. Let us see how.Here’s our Byte value.byte val = 16;To implicitly convert, just assign the value as shown below −decimal dec; dec = val;Let us see the complete example.Example Live Demousing System; public ... Read More
Ankith Reddy
247 Views
Orders elements in a sequence using ThenBy() method.We have the following string array.string[] str = { "AAA", "AAAA", "A", "AAAAA", "AAAAAAAAA" };Now, use Lambda Expressions and set a condition inside the ThenBy() method to sort the strings according to the number of characters they have.IEnumerable res = str.AsQueryable() .OrderBy(alp => ... Read More
Ankith Reddy
347 Views
To get the bounds of a three-dimensional array, use the GetUpperBound() GetLowerBound() methods in C#.The parameter to be set under these methods is the dimensions i.e.Let’s say our array is −int[, , ] arr = new int[3, 4, 5];For a three-dimensional arrays, dimension 0.arr.GetUpperBound(0) arr.GetLowerBound(0)For a three-dimensional arrays, dimension 1.arr.GetUpperBound(1) ... Read More
Ankith Reddy
180 Views
Set two sequences.double[] arr1 = { 10.2, 15.6, 23.3, 30.5, 50.2 }; double[] arr2 = { 15.6, 30.5, 50.2 };To get the difference between both the above arrays, use Except() method.IEnumerable res = arr1.AsQueryable().Except(arr2);The following is the complete code.Example Live Demousing System; using System.Linq; using System.Collections.Generic; class Demo { static ... Read More
Ankith Reddy
276 Views
The Single() method returns the only element that satisfies a condition. If more than one such element is visible, then an error is thrown.The following is our string array.string[] str = { "jack", "tom", "henry", "time"};Now, use the Single() method to get each element. Then, we have used Lambda Expression ... Read More