Quiz Permalink:
https://www.jobilize.com/c-certification-questions
Question Permalink:
https://www.jobilize.com/conditional-operator-in-java
Question 79 / 79:  What is the result of compiling and running the following code?
public static void main(String[] args) {

char c = 'c';

String result = (c > 'C') ? "c is greater than C " : "c is smaller than C";

System.out.print(result);

}

A  no output is produced
B  c is smaller than C
C  c is greater than C
D  compilation error
<< First < Previous Next > Last >>
Explanation:

The syntax for this conditional operator:

Var = (boolean expression) ? true case : false case

lowercase letters are greater than uppercase letters.

Quiz Home Page
https://www.jobilize.com/c-certification-questions

C Programming Language

Author:

Access: Public Instant Grading

Ask
Marion Cabalfin
Start Quiz
Madison Christian
Start Exam
Copy and paste the following HTML code into your website or blog.
<iframe src="https://www.jobilize.com/embed/c-certification-questions" width="600" height="600" frameborder="0" marginwidth="0" marginheight="0" scrolling="yes" style="border:1px solid #CCC; border-width:1px 1px 0; margin-bottom:5px" allowfullscreen webkitallowfullscreen mozallowfullscreen> </iframe>