Computer Science, asked by samrajeshcod6, 5 months ago

What will be the output of the following code? char x=‘A’; int m; m=(x==‘a’)What will be the output of the following code? char x=‘A’; int m; m=(x==‘a’)

Answers

Answered by mastergamerz083
0

Answer:

Pseudocode:

Line 1 initialize variable of char datatype, call it x and store character A inside

Line 2 store a new variable of type integer without initialization

Line 3 store the result of ternary operation in variable m which holds an int value

If x is 'aa', hold character 'A' inside m , otherwise hold 'aa'

Last 4 prints out string m= and the result stored in m

Problem 1:

Char only stores one character, so 'aa' will result in an error

Problem 2:

Storing char in int variable

Similar questions