>

설명

왼쪽 변수와 연산자 오른쪽 변수를 비교. 왼쪽 피연산자가 오른쪽 피연산자보다 크면 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 = 3; int y = 2; if (x > y) // tests if x is greater (bigger) than y Serial.println("x is greater than y"); } void loop() { }

시리얼 모니터에 결과:

COM6
Send
x is greater than 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.