C# Program - Check whether a number is prime or not | Digital Infotainment

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            int i, n,flag = 0;
            Console.Write("Enter a number");
            n = int.Parse(Console.ReadLine());
            for(i=1;i<=n;i++)
            {
                if (i % 2 == 0)
                    flag++;
            }
            if(flag==2)
            Console.Write("The number is Prime");
            else
            Console.Write("The number is not Prime");
            Console.ReadKey();
        }
    }
}

/*Do leave a comment if you find this useful*/

C# Program - Check whether a number is palindrome or not | Digital Infotainment

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            int n, temp, rev=0, pal;
            Console.Write("Enter a number");
            n = int.Parse(Console.ReadLine());
            pal = n;
            do
            {
                temp = n % 10;
                rev = rev * 10 + temp;
                n = n / 10;
            } while (n!=0);
            if(rev==pal)
            Console.Write("The number is Palindrome");
            else
            Console.Write("The number is not Palindrome");
            Console.ReadKey();
        }
    }
}

/*Do leave a comment if you find this useful*/

C# Program - Fibonacci Series | Digital Infotainment

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            int a=0, b=1, c, n;
            Console.Write("Enter a number");
            n = int.Parse(Console.ReadLine());
            Console.Write("The fibonacci series of the number is:");
            Console.Write(" "+a);
            Console.Write(" "+b);
            c=a+b;
            do
            {
                Console.Write(" " + c);
                a = b;
                b = c;
                c = a + b;
            } while (c <= n);
            Console.ReadKey();
        }
    }
}

/*Do leave a comment if you find this useful*/

C# Program - Factorial of a number | Digital Infotainment

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            int i,f, fact=1;
            Console.Write("Enter a number");
            f = int.Parse(Console.ReadLine());
            for(i=1;i<=f;i++)
            fact=fact*i;
            Console.Write("The factorial of the number is:"+fact);
            Console.ReadKey();
        }
    }
}

/*Do leave a comment if you find this useful*/

Sunset Stock Footage HD 1080p 2016 | Digital Infotainment

Welcome to Digitalinfotainment | Digital Infotainment

Welcome to Digital Infotainment!!

Hello Everyone !! Welcome to Digital Infotainment!!