
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Samual Sam has Published 2310 Articles

Samual Sam
235 Views
The following is our integer array −int[] myArr = new int[6] { 8, 4, 2, 5, 9, 14 };Firstly, get the length of the array, and loop through the array to find the sum of the elements. After that, divide it with the length.int ... Read More

Samual Sam
608 Views
To find the product of two binary numbers, firstly set them.val1 = 11100; val2 = 10001; Console.WriteLine("Binary one: "+val1); Console.WriteLine("Binary two: "+val2);Now loop through to get the product.while (val2 != 0) { digit = val2 % 10; if (digit == 1) { val1 = ... Read More

Samual Sam
930 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 ... Read More

Samual Sam
939 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 < ... Read More

Samual Sam
6K+ Views
Set the list.List < int > list = new List < int > (); list.Add(99); list.Add(49); list.Add(32);To get unique elements.List myList = list.Distinct().ToList();Here is the complete example to display unique values from a list.Example Live Demousing System; using System.Collections.Generic; using System.Linq; public class Demo { public static void Main() ... Read More

Samual Sam
2K+ Views
The Mutex class in C# is a synchronization primitive that can also be used for interprocess synchronization.Let us see how to create a new Mutex.private static Mutex m = new Mutex();Let us now see how to initialize a new instance of the Mutex class with a Boolean value.private static Mutex ... Read More

Samual Sam
6K+ Views
Firstly, set a string array.string[] values = { "tim", "amit", "tom", "jack", "saurav"};Use the Sort() method to sort.Array.Sort(values);Let us see the complete code −Example Live Demousing System; public class Program { public static void Main() { string[] values = { "tim", "amit", "tom", "jack", "saurav"}; ... Read More

Samual Sam
2K+ Views
Take two arrays:int[] arr2 = new int[5]; int[] arr3 = new int[5];Now, if the array element gets the remainder 0 on dividing by 2, it is even. Get those elements and add in another array. This loops through the length of the array:if (arr1[i] % 2 == 0) { ... Read More

Samual Sam
2K+ Views
Set the listvar val = new int[] { 99, 35, 26, 87 };Now get the largest number.val.Max(z => z);Smallest numberval.Min(z => z);Second largest numberval.OrderByDescending(z => z).Skip(1).First();Second smallest numberval.OrderBy(z => z).Skip(1).First();The following is the code −Example Live Demousing System; using System.Linq; public class Program { public ... Read More

Samual Sam
2K+ Views
Abstraction and encapsulation are related features in object-oriented programming. Abstraction allows making relevant information visible and encapsulation enables a programmer to implement the desired level of abstraction.Abstraction can be achieved using abstract classes in C#. C# allows you to create abstract classes that are used to provide a partial class ... Read More