Skip to content

Category Archives: C# Programs

Given an binary string as input, we need to write a program to convert the binary string into equivalent integer. To convert an binary string… Read More
Given an hexadecimal number as input, we need to write a program to convert the given hexadecimal number into equivalent integer. To convert an hexadecimal… Read More
Inner conditional operator can be used in any block,it shows like (a>b)?((a>c)?a:c):(b>c?b:c). Here we input three numbers and finding the largest number using nested conditional… Read More
C# Program to print weekday name from a given weekday number (0-6). A switch statement allows checking a value with a list of values or… Read More
Given an octal number as input, we need to write a program to convert the given octal number into equivalent integer. To convert an octal… Read More
As in other programming languages, various types of constants are defined the same as defined in C#, we can also define various types of constants… Read More
\ is a special character (sign) In C#. It is used for escape sequences(break out) such as to print a new line – we use… Read More
There are various method to print a new line within the message By using: \n – It prints new line. By using: \x0A or \xA… Read More
Given a number N (1<= N <=12), the task is to get a month name from a month number in C#. Examples: Input: N =… Read More
C# Program to swap the two numbers using Bitwise XOR Operation. Given two variables, x and y, swap two variables with using a XOR statements. … Read More
Given a char, the task is to convert this ASCII character into a Byte in C#. Examples: Input: chr = 'a' Output: 97 Input: chr… Read More
Given a number N, the task is to write a C# program to print the number of days in the Month N. Examples: Input: N… Read More
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: 6 Input: N… Read More