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

14th Aug 2019, 11:10 AM
Geek
Geek - avatar
4 ответов
+ 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!
14th Aug 2019, 12:48 PM
Bilbo Baggins
Bilbo Baggins - avatar
+ 1
Hope this is what you need..!!! https://code.sololearn.com/cBoagut76B2a/?ref=app
14th Aug 2019, 11:55 AM
Kuri
Kuri - avatar
+ 1
Thankyou so much for your time and help
14th Aug 2019, 1:23 PM
Geek
Geek - avatar
0
Okk
20th Oct 2024, 1:19 PM
Rajeswari Potteti
Rajeswari Potteti - avatar