논리 연산자

a && b //a and b, a 그리고 b 모두 참이면 참

a || b //a or b, a 또는 b 중에 하나라도 참이면 참

!a //a가 아니다 (논리 부정)

using System.Collections;

using System.Collections.Generic;

using UnityEngine;

public class NewBehaviourScript : MonoBehaviour

{

     int a = 1;

     int b = 1;

     bool c;

     void Start()

     {

          c = !(a == b); //결과 True가 부정연산자 !(느낌표) 때문에 False가 됨

          print(c);

     }

}


+ Recent posts