In this examples teach you how we identifying the number is Even or Odd. Check if theNumber is Even or Odd using if else Statement in C# Console Application. Example 1:
Tag - Algorithm Examples in C#
Convert Centimeters to Inches in C#
In this tutorial, I have decided to create a simple centimeter to inch calculator program in C# Console. First one we have to know how to convert cm to inch . 1cm=0.39370 inc here are the...
Fibonacci Series in C# with Method
We can optimize the recursive method for calculating the Fibonacci numbers by remembering (saving) the already calculated numbers in an array and making recursive call only if the number we are trying to calculate...
The Sum Of The First n Natural Numbers
Positive integers 1, 2, 3, 4… are known as natural numbers. This program takes a positive integer from user( suppose user entered n ) then, this program displays the value of 1+2+3+….+n. The program was...
Convert inches to cm in C#
In this tutorial, I have decided to create a simple to inch to cm calculator program in C# Console. First one we have to know how to convert inch to cm. 1inch=2.54cm
Generates the Sum of N Numbers in C#
This C# Program Generates the Sum of N Numbers. This Python program obtains the Nth number from the user and calculates its sum till the Nth number. Here is source code of the C# Program to Generate the Sum of N Numbers. ...
C# Program to Find the Factorial of a Number
In this article, you’ll learn to find the factorial of a number and display it. The factorial of a number is the product of all the integers from 1 to that number. For example, the factorial of 6 (denoted as 5!) is...
Program to Swap 2 Numbers in C#
This C# code swaps 2 Numbers. It obtains two numbers from the user and swaps the numbers using a temporary variable. You can find more similar examples of programming for this programming language in the site. Here is source code...
Add Two Numbers in C#
This tutorial demonstrates how to get two inputs from the user within a Console Application. We will learn how to add these numbers. Variables are defined in the first row. In the next lines, values are assigned to these...
C# Calculating Area and Perimeter of Pentagon
For calculate the area of a pentagon, “a” and “r” length must be known. You see a triangle in the bottom picture. After calculating the area of the triangle, the area of the pentagon can be found by...