+ 5
Felix Alcor I repeat this text so often because people answer with finished code so often. And many people do that, so we have to warn them too. Since you already saw this warning a good amount of times, pls just follow it, and help us improve the section. And pls understand I can't track how often each user got this warning. So we better warn than not.
14th Jul 2022, 8:13 PM
Emerson Prado
Emerson Prado - avatar
+ 2
You need to include everything inside a main function except the first line.
14th Jul 2022, 5:10 PM
Lama
Lama - avatar
+ 2
- Missing main - scanf(%s,&s) missing expressions - if(s!="BLAME) string to char, s is char Type, BLAME string
14th Jul 2022, 5:37 PM
Felix Alcor
Felix Alcor - avatar
+ 1
Aquila there is more to do. -> s should be a char array: char s[6] - that is 5 characters plus terminating null. -> scanf should read a string, not a char. Use "%s". -> string comparison cannot be done as a simple boolean comparison. Use the string.h library function strcmp(). -> be sure to close the braces on basic blocks. -> Add return 0; to properly exit from main().
14th Jul 2022, 6:11 PM
Brian
Brian - avatar
+ 1
Felix Alcor Pls don't give finished code as answer, because it makes the OP skip the most important part of the learning process. Prefer giving hints for the OP to find the solution.
14th Jul 2022, 6:46 PM
Emerson Prado
Emerson Prado - avatar
+ 1
Emerson Prado I meant don't warn the OP for giving his new Code. I was the only one who answered with similar Code.
14th Jul 2022, 8:23 PM
Felix Alcor
Felix Alcor - avatar
+ 1
Felix Alcor Ah, sorry, I got you now. Aquila is the OP, so the warning really doesn't fit. Thanks for the warning!
14th Jul 2022, 11:16 PM
Emerson Prado
Emerson Prado - avatar
0
I wrote something similar to what you want. Just Look at the Code when you don't want to try much more! https://code.sololearn.com/cN0VOokUlf0Z/?ref=app Giving the answer is better than let him give Up.
14th Jul 2022, 6:34 PM
Felix Alcor
Felix Alcor - avatar
0
Emerson Prado You don't need to always say that, and pls look sometimes who wrote. Aquila wrote his improved version. I just write that now because that happens rly often by you.
14th Jul 2022, 6:59 PM
Felix Alcor
Felix Alcor - avatar
0
Void main() and flower brackets {}
16th Jul 2022, 3:23 AM
PAIDI DINESHREDDY
PAIDI DINESHREDDY - avatar