Write using ternary operator int m ; char x=’A’; if (x==’a’) m=’A’ else m=’a’; brainly
Answers
Answered by
2
- Write the following code using ternary Operator.
Given code,
int m;
char x='A';
if(x=='a')
m='A';
else
m='a';
The given code can be written using ternary operator as,
int m;
char ch='A';
m=(x=='a')?'A':'a';
Similar questions