<

설명

왼쪽 변수와 연산자 오른쪽 변수를 비교. 왼쪽 피연산자가 오른쪽 피연산자보다 작으면 true 반환.

Please note that you may compare variables of different data types, but that could generate unpredictable results, it is therefore recommended to compare variables of the same data type including the signed/unsigned type.

문법

x < y; // x가 y보다 작으면 참

매개변수

  • x: 변수. 허용되는 자료형: int, float, double, byte, short, long
  • y: 변수 또는 상수. 허용되는 자료형: int, float, double, byte, short, long

예제 코드

void setup() { Serial.begin(9600); int x = 1; int y = 2; if (x < y) // tests if x is less (smaller) than y Serial.println("x is less than y"); } void loop() { }

시리얼 모니터에 결과:

COM6
Send
x is less than y
Autoscroll Show timestamp
Clear output
9600 baud  
Newline  

※ 주의 및 경고:

음수는 양수보다 작다.

더보기

ARDUINO BUY RECOMMENDATION

Arduino UNO R3
Arduino Starter Kit
Please note: These are Amazon affiliate links. If you buy the components through these links, We will get a commission at no extra cost to you. We appreciate it.

※ OUR MESSAGES