Showing posts with label csharp-programs. Show all posts
Showing posts with label csharp-programs. Show all posts

Friday, November 9, 2018

Prime numbers প্রিন্ট করার C# program

Prime Number হল সেই সংখ্যা যাকে ১ এবং ঐ সংখ্যা ছাড়া অন্য কোন সংখ্যা দিয়ে ভাগ করা যায় না। আমরা এই logic টা দিয়ে prime number বের কারার একটা C# program লিখতে চাই



using System;
using System.Collections.Generic;
using System.Linq;

namespace MainPrograms
{
    public class Program
    {
        public static void Main(string[] args)
        {

            // Declare a boolean variable to determine is if a number is prime
            bool isNumberComposite = false;
            int j;


            // Prompt the user to enter their target number
            Console.WriteLine("Enter your Target?");


            // Read the target number and convert to integer
            int target = Int32.Parse(Console.ReadLine());


            // 1 is neither prime nor composite. So start at 2
            for (int i = 2; i <= target; i++)
            {
                for (j = 2; j < i; j++)
                {
                    // A number is not prime if it is divisible by any other number, 
                    // other than 1 and itself.
                    if (i % j == 0)
                    {
                        isNumberComposite = true;
                        // We can break out of the inner for loop as we know the number 
                        // is not prime
                        break;
                    }
                }
                // Print the number if it is not composite
                if (!isNumberComposite)
                    Console.Write("{0} ", j);
                else
                    isNumberComposite = false;
            }

            // This line is to make the program wait for user input, 
            // instead of immediately closing
            Console.ReadLine();

        }
    }
}

C# program to print Fibonacci series

using System;
using System.Collections.Generic;
using System.Linq;

namespace MainPrograms
{
    public class Program
    {
        public static void Main(string[] args)
        {

            // Prompt the user to enter their target number
            Console.WriteLine("How many numbers do you want in the Fibonacci series");


            // Read the user input from console and convert to integer
            int Target = int.Parse(Console.ReadLine());


            //Declaring an Array where we will store our fibonacci series
            double[] fibonacci=new double[1000];


            //Initializing our fibnacci series with two intial fibonacci values
            fibonacci[0] = 0;
            fibonacci[1] = 1;


           // This for loop controls the number of fibonacci series elements
            for (int i = 2; i < Target; i++)
            {
                fibonacci[i] = fibonacci[i - 1] + fibonacci[i - 2];
            }


            //This for loop is for printing our fibonacci series
            for (int i = 0; i < Target; i++)
            {
                Console.WriteLine("{0}", fibonacci[i]);
            }


            Console.ReadLine();
        }
    }
}

C# program to print multiplication table

এই program দিয়ে যেকোনো সংখ্যার নামতা(multiplication) যেকোনো সংখ্যা পর্যন্ত print করানো যায় -


using System;
using System.Collections.Generic;
using System.Linq;

namespace MainPrograms
{
    public class Program
    {
        public static void Main(string[] args)
        {
            // Prompt the user to enter a number for the multiplication table
            Console.WriteLine("For which number do you want to print multiplication table");


            // Read the number from console and convert to integer
            int Number = Convert.ToInt32(Console.ReadLine());


            // Prompt the user for multiplication table target
            Console.WriteLine("What is your target? 10,20,30 etc...");


            // Read the target from console and convert to integer
            int Target = Convert.ToInt32(Console.ReadLine());


            // Loop to print multiplication table until we reach the target
            for (int i = 1; i <= Target; i++)
            {
                // Compute multiplication result
                int Result = Number * i;


                // Format and Print the multiplication table
                Console.WriteLine(Number.ToString()+"X"+i.ToString()+"="
                                                                                                 +Result.ToString());
            }

            // The above line can also be rewritten as shown below.
            // Console.WriteLine("{0} X {1} = {2}", Number, i, Result);
            Console.ReadLine();
        }
    }
}


C# program to print alphabets

এই c# program টি, ২ টা ভিন্ন approache এ upper এবং lower case alphabets কে print করতে পারে-

using System;
using System.Collections.Generic;
using System.Linq;

namespace MainPrograms
{
    public class Program
    {
        public static void Main(string[] args)
        {
            // Loop from a thru z (lower case alphabets)
            for (char i = 'a'; i <= 'z'; i++)
            {
                Console.Write(i+" ");
            }

            //Another way to print lower case alphabets
            //for (int i = 0; i < 26; i++)
            //{
            //    Console.Write(Convert.ToChar(i + (int)'a') + " ");
            //}

            Console.WriteLine();


            // Loop from A thru Z (upper case alphabets)
            for (char i = 'A'; i <= 'Z'; i++)
            {
                Console.Write(i+" ");
            }

            //Another way to print uppercase case alphabets
            //for (int i = 0; i < 26; i++)
            //{
            //    Console.Write(Convert.ToChar(i + (int)'A') + " ");
            //}
            Console.WriteLine();
            Console.ReadKey();
        }
    }
}

Power function in C#

Power() নামের একটা function লিখতে হবে যার ২ টা parameters থাকতে পারবে - Base এবং Exponent। function টির কাজ হবে ঐ Base এর power ঐ Exponent হলে কত হবে সেটা বলে দেয়া।
মানে হল যখন Power() method টাতে parameters হিসাবে 3 এবং 4 কে পাঠানো হবে তখন output হবে 3^4=81, i.e Power(3,4) should return 81.


using System;
using System.Collections.Generic;
using System.Linq;

namespace MainPrograms
{
    public class Program
    {
        public static void Main(string[] args)
        {
            // Prompt the user to enter base
            Console.WriteLine("Enter your Base");
            int Base = Convert.ToInt32(Console.ReadLine());



            // Prompt the user to enter exponent
            Console.WriteLine("Enter your exponent");
            int exponent = Convert.ToInt32(Console.ReadLine());



            // Call the power method passing it Base and Exponent
            int Result = Power(Base, exponent);



            // In System.Math class there is Pow() static method which is
            // very similar to the static Power() method we implemented
            // double Result = System.Math.Pow(Base, Exponent);

            // Print the result
            Console.WriteLine("Result={0}",Result);
            Console.ReadKey();
        }

        private static int Power(int Base, int exponent)
        {
            // Declare a variable to hold the result
            int Result = 1;


            // Multiply the Base number with itself, for 
            // exponent number of times
            for (int i = 1; i <= exponent; i++)
            {
                Result *= Base;
            }
            return Result;
        }
    }
}

C# program to count emails by domain


Email Address সেমিকোলন দিয়ে আলাদা করা এরকম একটা string আমাদের কাছে আছে -

string UserInputEmails = "aa@xyz.com;cc@abc.com;bb@abc.com;dd@abc.com";

একটা c# program লিখতে হবে, প্রতিটি Domain এর under এ কতগুলো করে email Address আছে তার একটা লিস্ট দেখাবে। উপরের UserInputEmails এর জন্য program এর output হবে এইরকম-

Domain = xyz.com & Count = 1
Domain = abc.com & Count = 3


using System;
using System.Collections.Generic;
using System.Linq;

namespace MainPrograms
{
    public class Program
    {
        public static void Main(string[] args)
        {


            // User List of emails seperated by semi colon. You can have as many
            // number of emails you want in this string.
            string UserInputEmails =
                                              "aa@xyz.com;cc@abc.com;bb@abc.com;cc@abc.com";



            // Split the string into a string array.
            string[] UserEmails = UserInputEmails.Split(';');



            // Select only the domain part of the emails into a string array,
            // using substring() function
            string[] UserdDomain= UserEmails.
                                         Select(x=>x.Substring(x.LastIndexOf("@")+1)).ToArray();



            // Group the emails by email domain, 
             // and select the Domain and respective count
            var Result = UserdDomain.GroupBy(x => x).
                                                  Select(y=>new { Domain=y.Key,Count=y.Count()});



            // Finally print the domain name and the emails count
            foreach (var item in Result)
            {
                Console.WriteLine("Domain={0} & Count={1}",item.Domain,item.Count);
            }


            Console.ReadLine();
        }
    }
}

Calculator program using C#

আমরা C# Programming language এ একটা simple calculator বানাবো, calculator টিতে নিচের এই features গুলো থাকবে ঃ
1. Adding 2 Numbers
2. Subtracting 2 Numbers
3. Multiplying 2 Numbers
4. Dividing 2 Numbers

এবং যতক্ষণ user program টি বন্ধ করতে না চাইবে ততোক্ষণ পর্যন্ত চালু থাকবে -


using System;
using System.Collections.Generic;
using System.Linq;

namespace MainPrograms
{
    public class Program
    {
        public static void Main(string[] args)
        {
            string UserSelection = String.Empty;
            do
            {
                PrintMenu();
                int UserChoice = Convert.ToInt32(Console.ReadLine());
                while (UserChoice<1 || UserChoice>4)
                {
                    Console.WriteLine("Invalid Option, Try again");
                    PrintMenu();
                    UserChoice = Convert.ToInt32(Console.ReadLine());

                }
                Calculate(UserChoice);
                Console.WriteLine("Do you want to continue");
                UserSelection = Console.ReadLine();
                while (UserSelection.ToUpper() != "YES" &&
                                                                  UserSelection.ToUpper() != "NO")
                {
                    Console.WriteLine();
                    Console.WriteLine("Invalid Input - Please type Yes or No");
                    Console.WriteLine("Do you want to continue");
                    UserSelection = Console.ReadLine();

                }

            }
            while (UserSelection.ToUpper()!="NO");
            Console.WriteLine();
            Console.WriteLine("This program will be tarminated right 
                                                                    now give any character input");
            Console.ReadLine();
        }

        private static void Calculate(int userChoice)
        {
            double Result = 0;
            Console.WriteLine("Please enter your first number");
            int firstNumber = Convert.ToInt32(Console.ReadLine());
            Console.WriteLine("Please enter your second number");
            int secondNumber = Convert.ToInt32(Console.ReadLine());
            switch (userChoice)
            {
                case 1:
                    Result = firstNumber + secondNumber;
                    Console.WriteLine("{0}+{1}={2}", firstNumber, secondNumber, Result);
                    break;
                case 2:
                    Result = firstNumber - secondNumber;
                    Console.WriteLine("{0}-{1}={2}", firstNumber, secondNumber, Result);
                    break;
                case 3:
                    Result = firstNumber * secondNumber;
                    Console.WriteLine("{0}*{1}={2}", firstNumber, secondNumber, Result);
                    break;
                case 4:
                    Result = firstNumber / secondNumber;
                    Console.WriteLine("{0}/{1}={2}", firstNumber, secondNumber, Result);
                    break;
            }
        }

        private static void PrintMenu()
        {
            Console.WriteLine();
            Console.WriteLine("Select your option");
            Console.WriteLine("------------------");
            Console.WriteLine("1. Addition");
            Console.WriteLine("2. Subtraction");
            Console.WriteLine("3. Multiplication");
            Console.WriteLine("4. Division");
            Console.WriteLine();
        }
    }
}

Thursday, November 8, 2018

Reverse characters in a string

C# এ একটা program লিখবো যার কাজ হবে একটি string এর characters গুলোকে reverse order এ সাজিয়ে দেয়া -

using System;
using System.Collections.Generic;
using System.Linq;

namespace MainPrograms
{
    public class Program
    {
        public static void Main(string[] args)
        {
            // Prompt the user to enter the string
            Console.WriteLine("Please enter your Desire String");

            // Read the user string from console
            string InputedString = Console.ReadLine();


            // The simple way to reverse a string is to use
            // the built-in .net framework Reverse() function
            List<char> OutputCharacterList = InputedString.Reverse().ToList();

            // Finally print each character from the collection
            foreach (var item in OutputCharacterList)
            {
                Console.WriteLine("{0}", item);
            }

            Console.ReadLine();
        }
    }
}

C# program to sort names in ascending and descending order

আমার কাছে userName এর একটা string আছে যেখানে প্রতিটি নাম semicolon দিয়ে seperated। আমি C# এ একটা program লিখতে চাই যেটি আমার userName গুলকে ascending এবং descending order এ short করে দেবে।

string strUserNames = "Rob;Mike;Able;Sara;Peter;John;Tom;Ben";



using System;
namespace MainPrograms
{
    public class Program
    {
        public static void Main(string[] args)
        {
            // Prompt the user to enter the list of usernames
            Console.WriteLine("Please enter the Name list separated by semicolon");

            // Read the user name list from the console
            string InputedNameList = Console.ReadLine();


            // Sampe list of user names that can be used as an input
            // strUserNames = "Rob;Mike;Able;Sara;Peter;John;Tom;Ben";


            // Split the string into a string array based on semi colon
            string[] InputedNameArray = InputedNameList.Split(';');


            // Print the names before sorting using foreach loop
            Console.WriteLine("NameList Before Sorting");
            foreach (var item in InputedNameArray)
            {
                Console.WriteLine("{0}",item);

            }


            // Sort the elements in the array in ascending order
            Array.Sort(InputedNameArray);

            // Print the elements of the array after sorting
            Console.WriteLine("NameList After Sorting in Assending Order");
            foreach (var item in InputedNameArray)
            {
                Console.WriteLine("{0}", item);

            }


            // Reverse the elements in the sorted array to get
            // the elements in descending order
            Array.Reverse(InputedNameArray);

            // Finally print the elements
            Console.WriteLine("NameList After Sorting in Decending Order");
            foreach (var item in InputedNameArray)
            {
                Console.WriteLine("{0}", item);

            }
            Console.ReadLine();

        }
    }
}

C# program to remove duplicates

Unique name print করার জন্য একটি program লিখব, যেখানে কোন duplicate entries থাকবে না। উদাহরণ সরূপ নিচের Input String এর কথা চিন্তা করি, এখানে Rob এবং Able নাম দুইটা দুইবার আছে, আমদের program এর কাজ হল এই একাধিকবার থাকা নাম গুলো কে eliminate করে দিয়ে প্রতিটি নামকে একবার করে দেখানো। সহজ কথায় একটা নাম output string এ একবারের বেশি থাকতে পারবে না। Program টা এরকম হবে - 


Input String = "Rob;Mike;Able;Sara;Rob;Peter;Able;"
Output String = "Rob;Mike;Able;Sara;Peter;"


using System;
using System.Linq;
using System.Text;

namespace MainPrograms
{
    public class Program
    {
        public static void Main(string[] args)
        {
            // Prompt the user to enter the list of user names
            Console.WriteLine("Please enter the name list separated by semicolon");

            // Read the user name list from the console
            string InputedNameString = Console.ReadLine();

            // Sampe list of user names that can be used as an input
            // strUserNames = "Rob;Mike;Able;Sara;Rob;Peter;Able";


            // Split the string into a string array based on semi colon
            string[] InputedNameListArray = InputedNameString.Split(';');

            // Use the Distinct() LINQ function to remove duplicates
            string[] DistinctNameListArray = InputedNameListArray.Distinct().ToArray();

            // Using StringBuilder to concatenate strings is more efficient
            // than using immutable string objects for better performance
            StringBuilder DistinctNameList = new StringBuilder();

            // Build the string from unique names appending semi colon
            foreach (var item in DistinctNameListArray)
            {
                DistinctNameList.Append(item+";");
            }
            // Remove the extra semi colon in the end
            string OutputedNameList = DistinctNameList.
                            Remove(DistinctNameList.ToString().LastIndexOf(';'),1).ToString();

            // Finally print the unique names
            Console.WriteLine("{0}", OutputedNameList);
            Console.ReadKey();
        }
    }
}

Wednesday, November 7, 2018

Insert space before every upper case letter in a string

এখন আমরা C# এ একটি program লিখবো যেটির কাজ হবে প্রতিটি upper case letter এর আগে একটি করে space character বসানো। উদাহরণ সরূপ মনে করুন আমাদের কাছে একটি string আছে "ProductUnitPrice", তাহলে আমদের Program এর output হবে "Product Unit Price"।


using System;
using System.Text;

namespace MainPrograms
{
    class Program
    {
        static void Main(string[] args)
        {
            // Prompt the user for input
            Console.WriteLine("please enter your Input String");

           // Read the input from the console
            string InputedString = Console.ReadLine();

            // Convert the input string into character array
            char[] InputedCharacters = InputedString.ToCharArray();

            // Initialize a string builder object for the output
            StringBuilder OutputString = new StringBuilder();

            // Loop thru each character in the string array
            foreach (var item in InputedCharacters)
            {
                // If the character is in uppercase
                if (char.IsUpper(item))
                {
                    // Append space
                    OutputString.Append(" ");
                }

                // Append every charcter to reform the output
                OutputString.Append(item);
            }
            // Remove the space at the begining of the string
            OutputString.Remove(0, 1);

            // Print the output
            Console.WriteLine("{0}", OutputString.ToString());

            Console.ReadKey();
        }

    }
}

Tuesday, November 6, 2018

Exception handling at its best

আমরা এখন দুটি number এর যোগফল বের করার program লিখব, program টি এরকম হবে যে, যদি user ইনপুট দিতে গিয়ে ভুল ইনপুট দিয়ে থাকে তাহলে program টি বন্ধ হয়ে যাবে না বরং আমরা সেটাকে exception handaler (try-catch) এর মাধ্যমে handle করব। উদাহরণ সরূপ আমাদের program নিচের error গুলো handle করতে পারবে, এমনকি program টি ততোক্ষণ চলবে যতক্ষণ user সেটিকে চালিয়ে যেতে চাইবে।

1.যদি user input হিসেবে "Ten" input দিয়ে থাকে, তাহলে program টি user কে বলে দেবে যে, শুধু Number এরই কেবল যোগ করা সম্ভব।
2. যদি user input হিসেবে অনেক বড় number input দেয়, তাহলে program বলে দেবে যে, Number এর range কত থেকে কত হওয়া উচিত।


using System;
namespace MainPrograms
{
    class Program
    {
        static void Main(string[] args)
        {
            string strUserChoice = String.Empty;
            do
            {
                try
                {
                    Console.WriteLine("Please enter first number");
                    int FN = Convert.ToInt32(Console.ReadLine());


                    Console.WriteLine("Please enter second number");
                    int SN = Convert.ToInt32(Console.ReadLine());


                    int Total = FN + SN;
                    Console.WriteLine("Total = {0}", Total);
                }
                catch (FormatException)
                {

                    Console.WriteLine("Invalid Input, only numbers please.");
                }
                catch (OverflowException)
                {
                    Console.WriteLine("Only numbers between {0} and {1} are allowed",
                                                                               Int32.MinValue,Int32.MaxValue);
                }
                catch (Exception)
                {
                    Console.WriteLine("Unknown problem, please try again");
                }
                do
                {
                    Console.WriteLine("Do you want to continue - Yes or No");
                    strUserChoice = Console.ReadLine();
                }
                while (strUserChoice.ToUpper() != "YES" &&
                                                                           strUserChoice.ToUpper() != "NO");

            }
            while (strUserChoice.ToUpper()!="NO");
        }
    }
}

একটি Integer Array থেকে Smallest এবং Largest Number খুঁজে বের করার C# Program

C# এ আমি এমন একটা Program লিখতে চাই জেন সেটি একটা Integer Array থেকে Smallest এবং Largest Number খুঁজে বের করতে পারে।

using System;
using System.Linq;

namespace MainPrograms
{
    class Program
    {
        static void Main(string[] args)
        {
            // Declare and initialize the integer array
            int[] NumbersArray = { 102, 34, 89, 12, 187, 29, 111 };

            // Sort the array, the first element in the array will be
            // smallest and the last element will be largest
            Array.Sort(NumbersArray);

            // Print the smallest number in the array
            Console.WriteLine("Smallest Number = {0}", NumbersArray[0]);

            // Print the largest number in the array.
            Console.WriteLine("Largest Number = {0}",
                                                  NumbersArray[NumbersArray.Length-1]);

            //will taking any character for vanishing console
            Console.ReadKey();

            // Linq makes this much easier, as we have Min() and Max() extension methods
            // Console.WriteLine("Samllest Number = {0}", NumbersArray.Min());
            // Console.WriteLine("Largest Number = {0}", NumbersArray.Max());
        }
    }
}

একটি Number এর factorial বের করার জন্য C# Program

গনিতে 5 এর factorial হিসেব করা হয় এভাবে, 5*4*3*2*1=120। 5 এর factorial লেখা হয় একটি 5 এবং একটি exclamation sign দিয়ে, যেমন-
5 Factorial = 5! = 5*4*3*2*1 = 120
4 Factorial = 4! = 4*3*2*1 = 24
3 Factorial = 3! = 3*2*1 = 6

Zero এর Factorial কিন্তু 1।

নিচের program এ দেখানো হল কিভাবে একটি number এর factorial বের করতে হয়


using System;
namespace MainPrograms
{
    class Program
    {
        static void Main(string[] args)
        {
            // Prompt the user to enter their target number to calculate factorial
            Console.WriteLine("please enter the number
                                               for which you want to calculate the factorial");
            try
            {
                // Read the input from console and convert to integer data type
                int iTarget = Convert.ToInt32(Console.ReadLine());
                // Factorial of Zero is 1
                if (iTarget==0)
                {
                    Console.WriteLine("Factorial of Zero =1");
                }
                // Compute factorial only for non negative numbers
                else if (iTarget<0)
                {
                    Console.WriteLine("please enter a positive number");
                }
                // If the number is non zero and non negative
                else
                {
                    // Declare a variable to hold the factorial result.
                    double dFactorialResult = 1;
                    // Use for loop to calcualte factorial of the target number
                    for (int i = iTarget; i >=1; i--)
                    {
                        dFactorialResult = dFactorialResult * i;
                    }
                    // Output the result to the console
                    Console.WriteLine("Factorial of {0}={1}", iTarget, dFactorialResult);
             
                }
            }
            catch (FormatException)
            {
                // We get format exception if user enters a word instead of number
                Console.WriteLine("please enter a valid number");
            }
            catch (OverflowException)
            {
                // We get overflow exception if user enters a very big number, 
                // which a variable of type Int32 cannot hold
                Console.WriteLine("Please enter a number between 1 and {0}",
                                                                                                    Int32.MaxValue);
            }
            catch (Exception)
            {
                // Any other unforeseen error
                Console.WriteLine("There is a problem! Please try later");
            }
            finally
            {
                Console.ReadKey();
            }
        }
    }
}


Monday, November 5, 2018

C# Programs

আমরা এখানে C# এর very basic কিছু programs দেখব যাতে করে আমাদের C# এর coding skill আরেকটু সুগঠিত হয়।

Sunday, November 4, 2018

কোন Decimal Number এর total number of decimal places বের করা

উদাহরণ সরূপ নিচের sample input এবং expected output এর কথা চিন্তা করুন-

InputOutput
10
1.00
1.11
1.122
1.1233
1.11002
1.0102
1.001100 4              


using System;
namespace CSharpPrograms
{
    class Program
    {
        static void Main(string[] args)
        {
            //creating a sample array for test data
            decimal[] decimalNumbers = { 1, 1.0M, 1.1M, 1.12M, 1.123M, 1.1100M,
                                                                                                   1.010M, 1.001100M };
            //loop thru the each decimal number
            foreach (var item in decimalNumbers)
            {
                Console.WriteLine("Orginal Number={0}, Total decimal Places=
                                                                     {1}", item, GetDecimalPartCount(item));
            }
            Console.ReadKey();
        }
        //function for returning total decimal places
          public static int GetDecimalPartCount(decimal n)
        {
            int decimaldigitcount = 0;
            //getting only decimal part
            decimal decimaldigit = n % 1;
            if (decimaldigit != 0)
            {
                //Get the index of dot from the decimal part
                int indexOfDot = decimaldigit.ToString().IndexOf(".");
                // Use the 0.######## format string to rip off trailing zeros, and get the count
                decimaldigitcount =
                    decimaldigit.ToString("0.#########"). Substring(indexOfDot).Length - 1;
            }
            return decimaldigitcount;
        }
    }
}

Decimal number থেকে trailing zeros remove করা

উদাহরণ সরূপ নিচের sample input এবং expected output এর কথা চিন্তা করুন-

InputOutput
1.01
1.011.01
1.00101.001
0.000
1.0050   1.005     

using System;

namespace decimeltotaileingzeroRemoving
{
    class Program
    {
        static void Main(string[] args)
        {
            decimal[] decimelArray = { 1.0M, 1.01M, 1.0010M, 0.00M, 1.0050M };
            foreach (var item in decimelArray)
            {
                Console.WriteLine("orginalNumber={0},tailingZeroRemoving={1}",
                 item, item.ToString("0.####"));
            }
            Console.ReadKey();
        }
    }
}


যদি আমি 1.1234567890 input দেই, তাহলে আমরা output হিসেবে 1.123456789 এর পরিবর্তে 1.1235 পাব। এইটার কারন হল আমরা ToString() function টিতে ৪ টি # symbol ব্যাবহার করেছি ( ToString("0.####") )। আপনি output হিসেবে দশমিকের পরে যতগুলো digit দেখতে চান ঠিক সেই সংখ্যক # symbol বসাবেন। C# এ সাধারনত decimal number এর ক্ষেত্রে ২৯ টি digit ধারন করতে পারে (includes both integral and decimal part )।