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

in #programming6 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.

Coin Marketplace

STEEM 0.18
TRX 0.16
JST 0.030
BTC 68227.33
ETH 2646.21
USDT 1.00
SBD 2.70