#include <stdio.h>
int force(int mass, int acce);
int main ()
{
int mass;
int acce;
scanf( "%d", &mass );
scanf( "%d", &acce );
printf("The force is %d n\ ",force(mass ,acce));
}
int force(int mass, int acce)
{
return mass * acce;
}
I am trying to run a simple program in C. When I run the above program I find the following error:
Force.c:12:11: warning: unknown escape sequence: '\040'.
The is not clear to me. Would you please give an explanation.
You put
n\in yourprintfstatement. I think you meant\n. This is called an escape character (this one is a newline). Yours was trying to do the escape character'\ '. If you want to print a single backslash, use\\.