New to C? Making changes to the program: same printed statements?

I’m having trouble getting my C code changes to be read by the program. Even when I make changes to the code, the same output is being produced.

#include <stdio.h>

int main()
{
    printf("hello world\n");
    return 0;
}

I’m having trouble getting my changes to the C code to be read by the program. No matter what changes I make, the same output is produced.

For example, if I change the statement to:

printf("hello\\n");

“hello world” is still printed, instead of just “hello”. What’s going on?

The issue is that the backslash character \ is an escape character in C. In the code snippet you provided, "hello\\n" is actually printing the backslash followed by the letter ‘n’, instead of interpreting it as a newline character.

To fix this, you should remove one backslash so that the code looks like this:

printf("hello\n");

Then, when you run the program, it will produce the output “hello” with a newline.