- 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
115 Views
The WindowsTop property is used to gets or set the top position of the console window area relative to the screen buffer.Declare an integer variable to get the top position.int top;Now, use the Console.WindowTop property.top = Console.WindowTop;Let us see the complete example.Example Live Demousing System; class Demo { static void ... Read More
Ankith Reddy
18K+ Views
Use the FirstorDefault() method to return the first element of a sequence or a default value if element isn’t there.The following is our empty list −List val = new List { };Now, we cannot display the first element, since it is an empty collection. For that, use the FirstorDefault() method ... Read More
Ankith Reddy
94 Views
Get the minimum value from a sequence using the Min() method in C#.The following is our list.List list = new List { 1, 2, 3, 4, 5, 6 };Now, use Queryable Min() method to get minimum element.list.AsQueryable().Min();Exampleusing System; using System.Collections.Generic; using System.Linq; class Demo { static void Main() { ... Read More
Ankith Reddy
616 Views
The following is our Hashtable −Hashtable h = new Hashtable(); h.Add(1, "Jack"); h.Add(2, "Henry"); h.Add(3, "Ben"); h.Add(4, "Chris");To remove an item, use the Remove() method. Here, we are removing the 3rd element.h.Remove(3);Let us see the complete example.Example Live Demousing System; using System.Collections; public class Demo { public static void Main() ... Read More
Ankith Reddy
1K+ Views
The Parse method in Enum converts the string representation of the name or numeric value of enum constants to an equivalent enumerated object.The following is our enumeration.enum Vehicle { Car, Bus, Truck, Motobike };Now, use the GetNames() method in a loop to get the enum values. Parse them using the ... Read More
Ankith Reddy
291 Views
Firstly, declare a LinkedList and add nodes.int [] num = {92, 98, 110, 130, 145, 170, 230, 240, 250, 300, 330}; LinkedList myList = new LinkedList(num);Remove the last node from the LinkedList using the RemoveLast() method.myList.RemoveLast();Example Live Demousing System; using System.Collections.Generic; class Demo { static void Main() { ... Read More
Ankith Reddy
440 Views
Convert a specified value to a 64-bit signed integer using Convert.ToInt64 Method.Let us take a double value.double doubleNum = 193.834;Now, convert it to Int64 i.e. long.long res; res = Convert.ToInt32(doubleNum);Example Live Demousing System; public class Demo { public static void Main() { double doubleNum = 193.834; ... Read More
Ankith Reddy
2K+ Views
To implicitly convert char to a Decimal, firstly set a char.char c = 'p';To convert char to decimal, assign the value.decimal dec; dec = c;Let us see the above example.Example Live Demousing System; public class Demo { public static void Main() { char c = 'p'; ... Read More
Ankith Reddy
85 Views
Set query in a select clause using the into operator.The following is our list with Employee details −IList employee = new List() { new Employee() { EmpID = 1, EmpName = "Tom", EmpMarks = 90, Rank = 8} , new Employee() { EmpID = 2, EmpName = "Anne", ... Read More
Ankith Reddy
13K+ Views
Use DateTime. DayOfWeek property to display the current day of week.DayOfWeek wk = DateTime.Today.DayOfWeek;Now, displaying “wk” would give you the current day of the week.Let us see the complete code to get the current day of week.Example Live Demousing System; using System.Linq; public class Demo { public static void Main() ... Read More