• Courses
  • Code Compiler
  • Discuss
  • Pricing
  • Teams
Menu
0

What is c>a?1:0

int a = 4; int b = 1; int c = ++a + - -b; System.out.println(c>a?1:0); Can someone explain why this is 0 and not 1? I thought c = 5 which means that c>a is true and the first statement is executed. What am I missing?

operatorternary
3rd Jan 2019, 10:24 PM
Lpia
1 Answer

Often have questions like this?

Learn more efficiently, for free:

  • Introduction to Python

    7.1M learners

  • Introduction to Java

    4.7M learners

  • Introduction to C

    1.5M learners

  • Introduction to HTML

    7.5M learners

See all courses
Hot today
Html 5 document question
1 Votes
"Which is harder to master — Machine Learning or Cybersecurity? And why?"
1 Votes
𝙵𝙸𝙽𝙳 𝚃𝙷𝙴 𝙸𝙽𝙿𝚄𝚃 𝙾𝙵 𝚃𝙷𝙴 𝙿𝚁𝙾𝙶𝚁𝙰𝙼
1 Votes
Is this realistic enough?
1 Votes
Python
0 Votes
Can someone explain inline and block elements please
0 Votes
"What’s the best way to combine creativity and coding? Can storytelling improve web apps?"
1 Votes
MASS N NUMBER OF OBJECT DELETION FROM A CLASS
0 Votes
Need friends
0 Votes
Schuffle a list
0 Votes