Skip to content

Category Archives: C# Programs

Given a year Y and month M, the task is to get a total number of days in a month in C#. Examples: Input: Y… Read More
In C#,  we know that Console.ReadLine() method is used to read string from the standard output device. Then this value is converted into the float… Read More
Given an integer N, the task is to find the absolute value of the given integer.Examples:   Input: N = -6 Output: 6Input: N = 12 Output: 12  … Read More
Given a string, the task is to convert this string into a character array in C#. Examples: Input: string Output: [s, t, r, i, n,… Read More
Graphics.DrawLine() Method is used to draw a line connecting the two points specified by the coordinate pairs. There are 4 methods in the overload list… Read More
This method is used to releases all resources used by the current instance of the CharEnumerator class. The Dispose() method leaves the CharEnumerator in an… Read More
Socket programming is a way of connecting two nodes on a network to communicate with each other. Basically, it is a one-way Client and Server… Read More
Question: Write code in C# to Hash an array of keys and display them with their hash code. Answer: Hashtable is a widely used data… Read More
ArrayList.CopyTo(Array, Int32) Method is used to copy the entire ArrayList to a compatible one-dimensional Array, starting at the specified index of the target array. Syntax:… Read More
This method is used to return the hash code for this instance. Syntax: public override int GetHashCode (); Return Value: This method returns a 32-bit… Read More
Given two sorted arrays and a number x, find the pair whose sum is closest to x and the pair has an element from each… Read More
There are n stairs, a person standing at the bottom wants to reach the top. The person can climb either 1 stair or 2 stairs… Read More
Given a text txt[0..n-1] and a pattern pat[0..m-1], write a function search(char pat[], char txt[]) that prints all occurrences of pat[] and its permutations (or… Read More
Given a positive integer N, count all possible distinct binary strings of length N such that there are no consecutive 1’s. Examples: Input: N =… Read More
Given an integer n, write a function that returns count of trailing zeroes in n!. Examples : Input: n = 5 Output: 1 Factorial of… Read More

Start Your Coding Journey Now!