- 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
Found 34485 Articles for Programming
![Arjun Thakur](https://www.tutorialspoint.com/assets/profiles/13574/profile/60_74441-1560315595.jpg)
1K+ Views
Let’s say you need to find the elements in the following list to be greater than 80.int[] arr = new int[] {55, 100, 87, 45};For that, loop until the array length. Here, res = 80 i.e. the given element.for (int i = 0; i < arr.Length; i++) { if(arr[i] res) { Console.WriteLine(arr[i]); } } } } }
![karthikeya Boyini](https://www.tutorialspoint.com/assets/profiles/13518/profile/60_31598-1537784993.jpg)
476 Views
Declare a list and add elements.List list = new List(); list.Add(50); list.Add(90); list.Add(50); list.Add(100);Now, use Distinct() method to get the unique elements only.List myList = list.Distinct().ToList();The following is the complete code to remove duplicate elements from a List −Example Live Demousing System; using System.Collections.Generic; using System.Linq; public class Demo { public static void Main() { List < int > list = new List < int > (); list.Add(50); list.Add(90); list.Add(50); list.Add(100); Console.WriteLine("Initial List..."); foreach(int a in list) ... Read More
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
670 Views
Set the first list.int[] arr1 = { 65, 57, 63, 98 };Now, set the second list.int[] arr2 = { 43, 65, 33, 57 };Let us now see the complete code to check if two lists have common elements using == and < operators.Example Live Demousing System; using System.Collections.Generic; using System.Linq; public class Program { public static void Main() { int[] arr1 = { 65, 57, 63, 98 }; ... Read More
![Ankith Reddy](https://www.tutorialspoint.com/assets/profiles/22328/profile/60_142162-1519038074.jpg)
962 Views
Firstly, declare and initialize a jagged array.int[][] arr = new int[][] { new int[] { 0, 0 }, new int[] { 1, 2 }, new int[] { 2, 4 }, new int[] { 3, 6 }, new int[] { 4, 8 } };Now use the length property to get the length.arr.LengthThe following is the complete code −Example Live Demousing System; public class Program { public static void Main() { int[][] arr = new int[][]{new int[]{0,0},new int[]{1,2}, new int[]{2,4},new int[]{ 3, 6 }, new int[]{ 4, 8 } }; // Length Console.WriteLine("Length:"+arr.Length); Console.WriteLine("Upper Bound: {0}",arr.GetUpperBound(0).ToString()); Console.WriteLine("Lower Bound: {0}",arr.GetLowerBound(0).ToString()); Console.WriteLine("Dimensions of Array : " + arr.Rank); } }OutputLength:5 Upper Bound: 4 Lower Bound: 0 Dimensions of Array : 1
![karthikeya Boyini](https://www.tutorialspoint.com/assets/profiles/13518/profile/60_31598-1537784993.jpg)
234 Views
To copy or clone a C# list, firstly set a list.List < string > myList = new List < string > (); myList.Add("One"); myList.Add("Two");Now declare a string array and use the CopyTo() method to copy.string[] arr = new string[10]; myList.CopyTo(arr);Let us see the complete code to copy a list into a one-dimensional array.Exampleusing System; using System.Collections.Generic; using System.Linq; public class Demo { public static void Main() { List < string > myList = new List < string > (); myList.Add("One"); myList.Add("Two"); myList.Add("Three"); myList.Add("Four"); ... Read More
![George John](https://www.tutorialspoint.com/assets/profiles/13511/profile/60_58410-1512537824.png)
6K+ Views
For validity of a password, you need to recall the concept when your create a password to signup to a website.While creating a password, you may have seen the validation requirements on a website like a password should be strong and have −Min 8 char and max 14 charOne upper caseOne special charOne lower caseNo white spaceLet us see how to check the conditions one by one.Min 8 char and max 14 charif (passwd.Length < 8 || passwd.Length > 14) return false;One upper caseif (!passwd.Any(char.IsUpper)) return false;Atleast one lower caseif (!passwd.Any(char.IsLower)) return false;No white spaceif (passwd.Contains(" ")) return false;Check for ... Read More
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
563 Views
Using Synchronization, you can synchronize access to resources in multithreaded applications.A mutex can be used to synchronize threads across processes Use it to prevent the simultaneous execution of a block of code by more than one thread at a time.C# lock statement is used to ensure that a block of code runs without interruption by other threads. A Mutual-exclusion lock is obtained for a given object for the duration of the code block.Thread pool in C# is a collection of threads. It is used to perform tasks in the background. When a thread completes a task, it is sent to ... Read More
![Chandu yadav](https://www.tutorialspoint.com/assets/profiles/22330/profile/60_142811-1519038104.jpg)
1K+ Views
The best IDE for C# on Windows is Microsoft Visual Studio. It is an IDE to develop websites, web apps, mobile apps, etc.The following are the features of Visual Studio IDE −Code Editor − Visual Studio has a code editor supporting syntax highlighting and code completion using IntelliSense.Breakpoints − Set breakpoints and allow monitoring the variable values as the execution progress.Extend Capability − With Visual Studio, you can extend the functionality of the IDE. The extension includes macros, packages, etc.Built-in-languages − Visual Studio supports more than 30 programming languages, including C#, F#, JavaScript, TypeScript, etc.Here are the steps to compile ... Read More
![Arjun Thakur](https://www.tutorialspoint.com/assets/profiles/13574/profile/60_74441-1560315595.jpg)
1K+ Views
To compile and execute C# programs on Linux, firstly you need to IDE. On Linux, one of the best IDEs is Monodevelop.It is an open source IDE that allows you to run C# on multiple platforms i.e. Windows, Linux and MacOS. Monodevelop is also known as Xamarin Studio. It has a C# compiler to run C# programs.Monodevelop has the following features −Multi-platform IDE − Supports Linux, Windows and macOS.Supports multiple languages − MonoDevelop supports multiple languages such as C#, F#, Visual Basic .NET, etc.Integrated Debugger − It comes with an integrated debugger for debugging Mono and native applications.Code Completion − ... Read More
![karthikeya Boyini](https://www.tutorialspoint.com/assets/profiles/13518/profile/60_31598-1537784993.jpg)
1K+ Views
To compile and execute C# programs on Mac, firstly you need to IDE. On MacOS, one of the best IDEs is Monodevelop.Monodevelop is an open source IDE that allows you to run C# on multiple platforms i.e. Windows, Linux, and MacOS. MonoDevelop is also known as Xamarin Studio.Monodevelop has a C# compiler to run C# programs. It can be used on Windows, macOS and Linux.For Mac, a special version of MonoDevelop was introduced and it was called Visual Studio for Mac. It has many of the features of what the same IDE provides for Windows like a tool for and ... Read More