My else if statement seems to be right but it wont run.. Anyone can help? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

My else if statement seems to be right but it wont run.. Anyone can help?

Else if statement to input the first letter of the color whether uppercase or lowercase and then output the color https://code.sololearn.com/ca8ZI6g5Ozrn/?ref=app https://code.sololearn.com/ca8ZI6g5Ozrn/?ref=app

22nd Nov 2021, 5:00 AM
Christian Jay Medallo
Christian Jay Medallo - avatar
6 Answers
+ 3
You need to enter char values in ' ' or " " marks. char r = 'r' color == 'R'
22nd Nov 2021, 5:11 AM
Rusiru Rathmina
Rusiru Rathmina - avatar
+ 3
char literals are wrapped in single quotes. C-string are wrapped in double quotes. getc() doesn't seem to work in Code Playground, no input dialog popping up asking for values.
22nd Nov 2021, 6:12 AM
Ipang
+ 1
Yeah i use other compilers and it works on them..
22nd Nov 2021, 8:05 AM
Christian Jay Medallo
Christian Jay Medallo - avatar
+ 1
Hiiii
23rd Nov 2021, 3:28 AM
Sonu Giri
+ 1
Im c++ Firends
23rd Nov 2021, 3:29 AM
Sonu Giri
0
Thanks man.. I cant believe i forgot and made a easy mistake
22nd Nov 2021, 5:16 AM
Christian Jay Medallo
Christian Jay Medallo - avatar