In Xcode, it says that I need to put an expected expression in a specific line of code in a program that I am working on.I am trying to figure out how to fix the error where it says the following: expected expression. It is a red error circle. I will attach the the program that I am working on so far. Here I am learning retrieving command line input. This is being written in C. I am going to attach the code in a sub post of this question because it exceeds the character limit when posting a question in OpenStudy. Thanks if anyone can help!! Best Regards, -Comm. Dan
#include <stdio.h> int main() { char response; printf("Are you over the hill (Y=Yes, N=No)"); response = getchar(); if (response == 'Y' || response == 'y') { printf("Sorry to hear it! Enjoy your life now!"); } else if (response == 'N' || response == 'n'); { printf("Glad you're not over the hill"); } else { printf("Response not understood. Enter a Y or N next time!"); } getchar(); return 0; }
Thanks if anyone can help!!
Join our real-time social learning platform and learn together with your friends!