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
Social Sciences,
3 months ago
English,
3 months ago
Social Sciences,
6 months ago
English,
6 months ago
History,
11 months ago
Chemistry,
11 months ago
Math,
11 months ago