Fibonacci Triangle in C Sharp

Fibonacci Triangle

In C#, we can take input from the user for the limit for a Fibonacci triangle. The Fibonacci series can then be printed for that … Read More

Categories C#

Number Triangle in C Sharp

Number Triangle

There are several ways to print a number triangle in C#.

Example:

using System;  
  public class Example  
   {  
     public static void Main(string
Read More
Categories C#

Alphabet Triangle in C Sharp

Alphabet Triangle

In C#, we can print two types of triangles, either generated by letters or numbers.

Example:

using System;  
  public class Example  
   {  
     public static
Read More
Categories C#

Decimal to Binary in C Sharp

Decimal to Binary

A decimal or a base-10 number can be converted into binary or base-2 number in C#.

Decimal Number:

A decimal number ranges from 0 … Read More

Categories C#

Swap Numbers in C Sharp

Swap Numbers

In C#, we can swap two numbers without using a third variable, using either of the two ways:

  1. By using the + and – operators
Read More
Categories C#

Reverse number in C Sharp

Reverse number

Loop and arithmetic operators can be used in C#, to reverse a number.

Example:

using System;  
  public class Example  
   {  
     public static void Main
Read More
Categories C#

Sum of digits in C Sharp

Sum of digits

We are using a loop and mathematical operations to print the sum of digits in C#.

Algorithm:

  • Step 1: Take input from the user.
Read More
Categories C#

Factorial in C Sharp

Factorial

For a number n, the product of all its positive descending integers is called it’s factorial which is denoted by n! and is pronounced as “n … Read More

Categories C#