0
What is the error in this program?
Leela is a science teacher for class V and she wants to divide the class into two halves based on the starting letter of the names of the students. Accept the first letter of name L of the students in the class and print "1st half", if the name of the student starts with 'A' to 'M'. Print "2nd half", if the name of the student starts with 'N' to 'Z' Input Format: The first line contains a character L Output Format: Print 1st half or 2nd half for the input value L based on the conditions given. Example Input/Output 1: Input: A Output: 1st half Example Input/Output 2: Input: x Output: 2nd half https://code.sololearn.com/cfRvFJAhL1iq/?ref=app
4 Respuestas
+ 2
Two errors in your code:
(1) too many ORs: lines 43 and 45, instead of ...||...||...||..., must be ...&&...||...&&...
(2) input is a character, so scanf format must be "%c" and not "%d"
Happy SoloLearning!
+ 1
Hope this is what you need..!!!
https://code.sololearn.com/cBoagut76B2a/?ref=app
+ 1
Thankyou so much for your time and help
0
Okk