Tag:Empty statement

  • Question mark statement


    #include<iostream> using namespace std; int main(void) { int a = -1; a > 0 ? a = a : a = -a; cout << a; return 0; } The output is 1 Question mark statement means whether the statement before the question mark is true. If it is true, the statement before the colon will […]

  • Why don’t Python use semicolons as terminators?


    Generally speaking, the semicolon “;” is used in programming languages to achieve two purposes As statement separator: use semicolons to separate statements so that you can write multiple statements (one line, multiple sentences) in one line of code As statement Terminator: use a semicolon to terminate a statement so that multiple lines of code can […]