Below is the code, when it run shows a combination of back-slash and forward slash and by putting them together and printing them shows a stick rotating. The problem is that it is only rotating at a same position I want to move it back and forth in a line.
void run()
{
while(1)
{
printf("\\");
sleep(0.5);
printf("\t");
printf("\r");
printf("|");
sleep(0.5);
printf("\t");
printf("\r");
printf("/");
sleep(0.5);
printf("\t");
printf("\r");
}
}