inblog logo
|
Gyeongwon's blog
    FlutterDart

    [Dart 문법 #2] 연산자.조건문

    도경원's avatar
    도경원
    Sep 22, 2025
    [Dart 문법 #2] 연산자.조건문
    Contents
    1. 조건문2. 삼항연산자

    1. 조건문

    // 조건문 void main() { int point = 90; if (point >= 90) { print("A"); } else if (point >= 80) { print("B"); } else { print("F"); } }

    2. 삼항연산자

    // 삼항 연산자 void main() { int point = 60; // 표현식 (값을 출력, 리턴, 결과값을 응답해주는 것) String result = point >= 60 ? "합격" : "불합격"; print(result); }
     
    Share article
    Contents
    1. 조건문2. 삼항연산자

    Gyeongwon's blog

    RSS·Powered by Inblog