대입연산자

: =

 

대입문

: =이 있는 문장

 

코드

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace A006_Assignment
{
    class Program
    {
        static void Main(string[] args)
        {
            int i;
            double x;

            i = 5;
            x = 3.141592;
            Console.WriteLine("i = " + i + ", x = " + x);

            x = i;
            i = (int)x;
            Console.WriteLine("i = " + i + ", x = " + x);
        }
    }
}

 

코드 실행

반응형

'C# > C# 입문' 카테고리의 다른 글

8. Console.WriteLine 메소드로 여러 개의 값을 출력  (0) 2024.09.02
7. Console.WriteLine 메소드  (0) 2024.09.02
5. 문자와 문자열  (0) 2024.09.01
var 형  (0) 2024.09.01
4. 변수 선언 및 자료형(Type)  (0) 2024.09.01

+ Recent posts