I know this is a very silly and simple question but I've been trying to print out an image of a robot that should output this:
+----------+
| |
| /\ /\ |
| \/ \/ |
| |
| [-=-=-] |
+----------+
The part I'm stuck on is printing out the eyes. originally I coded:
printf("| /\ /\ |");
printf("| \/ \/ |");
but an error showed, so I remembered that you need to double slash so:
printf("| \/\\ \/\\ |");
printf("| \\\/ \\\/ |");
but an error saying implicit declaration of function printf is showing even after that?! I don't understand the error. Can someone explain how to fix this please?
You don't need to escape forward slash.
This works for me:
#include <stdio.h>
int main()
{
printf("| /\\ /\\ |");
printf("| \\/ \\/ |");
return 0;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With