1790

How to Update Members of a Collection with LINQ

Do you believe that you can update the items in the collection using a single line of code? Yes, it’s possible using the LINQ. There are several ways to update the items in the collection like using a foreach loop like below. but the problem here is that it’ll iterate through all items in the […]

Read More
2927

Virtual Networks

Virtual Network(VNet): The Virtual Network is an isolated private network that supports connectivity between resources via private IP addresses. Subnet: This is a private address space within a Virtual Network, where supported Azure resources are deployed to. A virtual network has one or more subnets. Resources that require network connectivity must reside in a subnet. […]

Read More
1495

Array

Array :  An array is a fixed-size collection of the same type of elements. We know that variable can store single value but it does not support to store multiple values. So, C# introduced an array to overcome the problem. Array is a reference type and it uses a namespace System.Array. Array is a fixed-size […]

Read More
924

Factorial

Factorial is the product of an integer and all the integers below it; for example, factorial four (4!)=1*2*3*4=24. C# program for Factorial. using System; namespace Factorial { class Program { static void Main(string[] args) { int factorialNumber=1; Console.Write(“Please enter a number:”); int number = int.Parse(Console.ReadLine()); for(int i=1; i

Read More
1052

Count number of prime numbers in a given range

A prime number is a number that is greater than 1 and can not be the product of two smaller numbers. In short, a Prime number is a number can’t be divided by other numbers than itself or 1. For example 2, 3, 5, 7, 11, 13, 17, 19, 23.. C# program that returns the […]

Read More
1110

Armstrong number

Armstrong number is that the sum of the cubs of it’s digits is equal to the number itself. For example, 0, 1, 153, 370, 371 and 407 etc. 371 is an Armstrong number since 3**3 + 7**3 + 1**3 = 371. C# program for armstrong number. using System; namespace ArmstrongNumber { class Program { static […]

Read More
855

Palindrome number

Palindrome number is a number that remains the same when its digits are reversed. For example 121, 43234, 1234321 etc. C# program for Palindrome Number. using System; namespace PalindromeNumber { class Program { static void Main(string[] args) { int originalNumber, tempNumber, temp, reverseNumber=0; Console.Write(“Please Enter a number : “); originalNumber = int.Parse(Console.ReadLine()); tempNumber = originalNumber; […]

Read More
1010

Reverse number

Reverse a number program will display digits in reverse order of any given number. C# program for Reverse a Number. using System; namespace ReverseNumber { class Program { static void Main(string[] args) { long reverseNumber = 0; Console.Write(“Please enter a number :”); int number = int.Parse(Console.ReadLine()); while(number>0) { int temp = number % 10; reverseNumber […]

Read More
1337

Fibonacci series

The Fibonacci Series start with 0 and 1. After that the every number in the series is the sum of the last 2 elements. C# program for Fibonacci Series using System; namespace FibonacciSeries { class Program { static void Main(string[] args) { int i = 0, j = 1, temp = 0; Console.Write(“Please enter a […]

Read More
1259

Check a number is prime or not

A prime number is a number that is greater than 1 and can not be the product of two smaller numbers. In short, a Prime number is a number can’t be divided by other numbers than itself or 1. For example 2, 3, 5, 7, 11, 13, 17, 19, 23.. C# program to check if […]

Read More