Mystery Number in C#

In this tutorial, we will write a c# program to check if a number is a Mystery Number. Before that, we may go through the following topic in c#. methods in c# A mystery number is a number that can be expressed as the sum of two numbers and those two numbers should be the … Read more

Bubble Sort Program in C#

Sorting is a technique for organizing the elements in an increasing or decreasing order. Bubble Sort is a comparison-based algorithm in which the adjacent elements are compared and swapped to maintain the order. Bubble Sort Algorithm Bubble sorting is the simplest sorting algorithm that works by comparing two adjacent elements in an array and swapping them if found in the … Read more

C# Program to Add Two Matrices

In this article, you will dd two matrices in C#. For matrix addition, we require two matrices and both the matrices must be a square matrix. Explanation:We first take the user input for a number of rows and the number of columns. Then passing rows and columns, we take input for two matrices A & … Read more

C# Program for Matrix Subtraction

In this tutorial, we will write a C# program to subtract two matrices. For matrix Subtraction, we require two matrices and both the matrices must be a square matrix. Explanation:We first take the user input for a number of rows and the number of columns. Then passing rows and columns, we take input for two matrices A … Read more

C# Program for Pass by Value

This article shows the use of pass by value in C#. You may go through the following theory on pass by value in C#, click the link below. C# pass by value The program has a variable num value which is passed to the method square() as an argument. This calculates and displays the results … Read more

C# Program to check whether a Number is Even or Odd

This article of C# Program checks if a given integer is Odd or Even, we have used the Ternary Operator (?:) and also seen the use of try and catch block. Explanation:The user enters the number that needs to be check for odd or even numbers. Here the entered number is checked with i % … Read more

C# Program to Swap Two Numbers

In this tutorial, we will write a program to swap two numbers in C#. We will use a temporary variable to swap the numbers along with a user-defined function. Question:Write a C# program to Swap two Numbers using third variable. Explanation:The user input values are passed as an argument in SwapValue function where they are … Read more

C# Program to find the Sum of Digits of a Number

In this tutorial, we will write a C# program to get a number and display the sum of the digits. We will see the use of a do-while loop and get the user inputs with source code. Explanation: The program takes a number from the user as input and passes that number to a function … Read more

C# Program to display the Date in various Formats

In this tutorial, we will write a C# program to display date formats, you see the list of various ways in which you can display dates in C#. A new date object is created for DateTime class in C#. DateTime class is already defined class present in C# language. We do not have to create … Read more

Example Program for Access Modifiers in C#

This tutorial demonstrates the use of Access Specifiers in C# shows the accessing of different specifiers present in C# with source code. You may go through the theory of access modifiers in C#. C# Access Specifiers Question:Write a C# program to Illustrate the Use of Access Specifiers Example Program for Access Modifiers in C# Source … Read more