Explanation for solution of Q2 and 3 of the Quiz

I couldnt understand on what basis was the precdance of bool, int, float and char decided?

In the next question, it should have given error. Why does it give output 9A?

hello @ritkumar

pls share the question with me in which u have doubt, i m not having access to quiz question.

"What is the order of precedence for int, float, char and bool "?

"/* The output of the following program is ? */ 1) #include 2) using namespace std; 3) int main(){ 4) signed CodingBlocks = 9; 5) signed Nagarro = A; 6) signed char HackerBlocks = ‘A’; 7) cout<<CodingBlocks<<endl; 8) cout<<HackerBlocks<<endl; 9) return 0; } "

here question asking about the precedence of implicit type conversion
All the data types of the variables are upgraded to the data type of the variable with the largest data type.

here in line 5 , is ‘A’ in quotes ? or its just A.

if it is just A then it will compile error, becuase we have never defined variable A in our program

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.

The question is copied as it is from the quiz, and there is no error according to the answers given.

the code will give compile error( u can run and check ).