C Sharp Program to subtract 2 numbers without using arithmetic operators.

Subtract 2 numbers without using arithmetic operators – Learn how to subtract 1 from a given input number and also learn how to subtract 2 given input numbers with example programs. To subtract 1 from a number x, set all the the bits to 1 after the rightmost 1 bit. finally unset the right most … Read more C Sharp Program to subtract 2 numbers without using arithmetic operators.

C Sharp program to Find the contiguous sub array with Maximum sum

Given an array of N integers.Find the contiguous sub array with Maximum sum. Contiguous sub array means sub-array with sequence index like (0,1,2..) or(1,2,3…) INPUT N:Size of the array arr[N]: arr[0],arr[1]…. arr[N-1] number of integer elements Output Print the maximum sum of the contiguous sub-array in a separate line for each test case. For Example: … Read more C Sharp program to Find the contiguous sub array with Maximum sum

C Sharp Program To Find Largest Number In An Array Easy Way

C# program to find largest number in an array with simple logic and example and test cases. Example: Input Array: 2 6 4 8 9 Output: 9 LOGIC: Create an integer variable and store first element of the array into it, assuming this is largest value. Traverse the array using for a loop from location … Read more C Sharp Program To Find Largest Number In An Array Easy Way

Thread synchronization using monitors in C Sharp

Thread synchronization using monitors in C# -Learn how to synchronize threads in executing a piece of common code using locks and monitors with example programs. Lock is the keyword in C# that will ensure  only one thread is executing a piece of code . The lock keyword ensures that one thread does not enter a … Read more Thread synchronization using monitors in C Sharp

Thread Priority in C sharp

Thread Priority- A thread’s Priority property determines how much execution time it gets relative to other active threads in the operating system. Thread priorities in C# are available in ThreadPriority class from namespace System.Threading; Below C# thread priority can be assigned to a thread. Highest AboveNormal Normal BelowNormal Lowest By default “Normal” thread priority is … Read more Thread Priority in C sharp