#CodeOfTheDay 1 - What is the output of this c# code ?

in programming •  6 years ago 

Lets start my blog with some simple c# code for you guys to solve. Every right answer gets a upvote.


CODE:

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Threading.Tasks;


namespace steemit_1

{

    class Program

    {

        static void Main(string[] args)

        {

            int day=12;

            Convert(day);

            Console.ReadLine();

        }



       static public void Convert(int a)

        {

            string ret= "";

            for (int i = 0; i < a;i++)

            {

                ret = ret + "a";

            }

            Melt(ret.Length/2%2);

        }


        static public void Melt(int r)

        {

            string m = r > 10 ? "Good day" : "Good night";

            Steemit(m);

        }


        static public void Steemit(string s)

        {

            int a = s.Length > 8 ? 12 : 21;

            Console.Write( a + ":" + s);

        }

    }

}


Please comment the answers down below.

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

12:Good night

Correct :D