Showing posts with label Divisible Number in C#. Show all posts
Showing posts with label Divisible Number in C#. Show all posts

Friday, October 20, 2017

Divisible Number in C#

A simple program that I wrote using C# as my programming language to check if the given number is divisible or not.  I am using Mono as my C# compiler that is free to download over the Internet.

I am currently accepting programming work kindly contact me in the following email address for further details. Thank you.

My email address are the following jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental is (034) 4335675.




Sample Program Output


Program Listing

divisible.cs

using System;

namespace divisible
{
    class divisible
    {
        static void Main(string[] args)
        {
            int num=0;
Console.Clear();
Console.Write("\n\n");
Console.Write("Checking Number Divisibility");
Console.Write("\n\n");
            Console.Write("Enter Any Number :  ");
            num=Convert.ToInt32(Console.ReadLine());

if((num%5 == 0) && (num%11 == 0) )
{
Console.Write("\n\n");
Console.Write("Number is divisible by 5 and 11.");
}
    else
{
Console.Write("\n\n");
Console.Write("Number is not divisible by 5 and 11.");
}
      Console.Write("\n\n");
Console.Write("End of Program");
Console.Write("\n\n");
            Console.ReadLine();
        }
    }

}