+ 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.
+ 2
You need to include everything inside a main function except the first line.
+ 2
- Missing main
- scanf(%s,&s) missing expressions
- if(s!="BLAME) string to char, s is char Type, BLAME string
+ 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().
+ 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.
+ 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.
+ 1
Felix Alcor Ah, sorry, I got you now. Aquila is the OP, so the warning really doesn't fit. Thanks for the warning!
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.
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.
0
Void main() and flower brackets {}