How to use short if in Dart

2 Answers

0 votes
main() {
    int num1 = 2345;
    int num2 = 901;

    int mx = num1 > num2 ? num1 : num2;

    print(mx);
}





/*
run:

2345

*/

 



answered Oct 21, 2022 by avibootz
0 votes
main() {
    3 + 7 == 10 ? print('true') : print('false');
}




/*
run:

true

*/

 



answered Oct 21, 2022 by avibootz

Related questions

1 answer 119 views
119 views asked Oct 8, 2022 by avibootz
2 answers 166 views
166 views asked Oct 7, 2022 by avibootz
1 answer 178 views
2 answers 182 views
1 answer 122 views
...