Answer to Question #277770 in C for Mr Z

Question #277770

write a program, When the racer is outside the covered section:


The two headlights and the rear light must turn ON and OFF alternatively (when headlights are ON, the rear light must be OFF and vice versa) for 1 second in each state.


• When the racer is inside the covered section: The two headlights must turn ON and OFF alternatively for 0.5 seconds in each state. The rear light must stay ON for the whole duration. 


1
Expert's answer
2021-12-10T00:36:43-0500
 #include<stdio.h>


int main()
{
    int i;
   for(i = 0; i < 1000;i++)
   {
   	
   	printf("The two headlights are ON and the rear light is OFF\n");
      Sleep(1);
     printf("The two headlights are OFF and the rear light is ON\n");
   }
   return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS