In this example we’ll learn How to find first and last digit of any number in C#. C# Code: C# static void Main(string[] args) { int num, last; // Reading number Console.Write("Enter any number: "); num = Convert...
Tag - C# while loop Examples
Division without using ‘/’ operator in C# Program
This program allows to simulate the operation of an integer division between 2 positive integers a and b entered, we divide the largest over the smallest without using the operator “/” and then display the quotient...
Reverse an Integer in C#
In this program you will learn how to reverse an integer number in C# language. The program takes the number by the user, then displays the reversed number on the screen. For example, if the user enters 678 as input, 876 is...
Program to Find LCM of Two Numbers in C# Console
In this example, you will learn how to Find the LCM value of two numbers entered by user in C# Console. Pseudocode: INI BEGIN NUMBER n1 , n2 , lcm; OUTPUT "Enter first Number:"; INPUT n1 OUTPUT "Enter second Number:"; INPUT n2...
C# Loop Examples
Loops are structures that control repeated executions of a block of statements. • C# provides a powerful control structure called a loop, which controls how many times an operation or a sequence of operation is performed in...