Have you tried to compile it?
You will get some error message indicating which lines you should check:
if strcmp(passwordone,passwordtwo ==0)
That is obviously invalid C/C++ syntax. It must be
if (strcmp(passwordone,passwordtwo) == 0)
For this line the compiler complains about
Should be obvious how to fix this.
The compiler might also complain about having no declaration for
(depends on the used compiler). Include string.h
which contains the declaration.
Finally, never use the
instead (but note that this will not remove the new line from the input so that you have to do it by code).
To fulfill the requirement of writing to the file only when the passwords match, perform the writing to the output file including the opening and closing in the corresponding
block at the end of your program.