'출력함수'에 해당되는 글 1건

  1. 2017.04.18 [C#] Console.WriteLine() 함수의 사용법

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Threading.Tasks;


namespace ConsoleApplication2

{

    class Program

    {

        static void Main(string[] args)

        {


            Console.WriteLine("Hello 월드!");

            Console.WriteLine("Hello 월드!");

            Console.WriteLine("Hello 월드!");


            Console.Write("Hello");

            Console.Write("Hello");

            Console.Write("Hello");

        }

    }

}


WriteLine() 함수도 텍스트를 출력하는 함수이고,

Write() 함수 역시 동일한 함수이다.


하지만, 차이점은

WriteLine() 함수는 출력한 뒤에 개행이 이뤄지지만,

Write() 함수의 경우 개행되지 않는다.


따라서, 위 예제를 실행하면 결과는 다음과 같다.




Posted by sungho88
,