Which of the following statements are correct about the following code snippet? int a = 10; int b = 20; bool c; c = !(a > b); 1. There is no error in the code snippet. 2. An error will be reported since ! can work only with an int. 3. A value 1 will be assigned to c. 4. A value True will be assigned to c. 5. A value False will be assigned to c.

- Online Exam Test Papers | - MCQs[multiple choice questions and answers ] | - Mock Test Papers | - Practice Papers | - Sample Test Papers |

Question:
 
Which of the following statements are correct about the following code snippet?

int a = 10; 
int b = 20;
bool c;
c = !(a > b);
1. There is no error in the code snippet.
2. An error will be reported since ! can work only with an int.
3. A value 1 will be assigned to c.
4. A value True will be assigned to c.
5. A value False will be assigned to c.

1.1,3

2.2,4

3.4,5

4.1,4

Posted Date:-2021-02-25 10:28:15


More MCQS Questions and answers

Search
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!