<=

설명

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

문법

x <= y; // is true if x is smaller than or equal to y and it is false if x is greater than 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) // x가 y보다 작거나 같으면 Serial.println("x is less than or equal to y"); } void loop() { }

시리얼 모니터에 결과:

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

※ 주의 및 경고:

음수는 양수보다 작다.

더보기

ARDUINO BUY RECOMMENDATION

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

※ OUR MESSAGES

  • We are AVAILABLE for HIRE. See how to hire us to build your project
  • Any suggestion, correction, and translation? please email us at ArduinoGetStarted@gmail.com, We appreciate it
  • We mainly keep improving the references in English. See English version of this page for the latest update.