Q:

Write a C# Sharp program to check whether a given word is plural or not

0

Write a C# Sharp program to check whether a given word is plural or not

Singular means only one and plural means more than one. In order to make a noun plural, it is usually only necessary to add s.

Sample Output:

Is 'Exercise' is plural? False
Is 'Exercises' is plural? True
Is 'Books' is plural? True
Is 'Book' is plural? False

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

using System;
namespace exercises
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Is 'Exercise' is plural? " + test("Exercise"));
            Console.WriteLine("Is 'Exercises' is plural? " + test("Exercises"));
            Console.WriteLine("Is 'Books' is plural? " + test("Books"));
            Console.WriteLine("Is 'Book' is plural? " + test("Book"));
        }
        public static bool test(string word)
        {
            return word.EndsWith("s");
        }
    }
}

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now