I’m having some trouble making a print statement that includes quotes and a new line escape sequence. I tried to use \n for a new line and backslash before open quote and before closing quotes to tell my program to include the quotations. I don’t know where I went wrong and I keep getting an error in my int main(void) line (sorry if I’m not using correct terminology, I’m in an intro c MOOC).
#include <stdio.h>
int main(void){
printf("Dennis Ritchie said:\n\"The only way to learn a new programming language is by writing programs in it.\");
return 0;
}
>Solution :
You’re only missing closing " and \n for readability:
printf("Dennis Ritchie said:\n\"The only way to learn a new programming language is by writing programs in it.\"\n");