Question: I am working on a lab in C using fgets and I'm having an issue. So when I'm asking for user imput to consul, when
I am working on a lab in C using fgets and I'm having an issue. So when I'm asking for user imput to consul, when the user preses "enter" to submit their answer, the compiler is reading it as a new line character ( ) so I have to include it in the string name in order for the rest of the program to run properly. However, when I want to print a reply with aditional text after the string, the new line character is causeing an issue by moving the rest of the text to a new line as well.
I created a piece of example code to demonstrate my issue. I would like it to print "Blue is my favorite too!" without making the text after "Blue" go on the next line.
Thank you!
88 K A example example c main.c Of main() #include
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
