Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Create a timer where - when the timer finishes, an alarm will ring once. If you don’t click the button to turn it off, the alarm will repeat until it is turned off.
- */
- using System;
- namespace DoWhileLoop
- {
- class Program
- {
- static void Main(string[] args)
- {
- bool buttonClick = true; //buttonClick = true means button is pressed to turn off, so loop will stop
- //buttonClick = false means the loop will keep going where statement will be printed repeatedly
- do {
- Console.WriteLine("BLARRRRRRRRR");
- } while(!buttonClick); //condition where loop will stop when buttonClick is NOT true
- Console.WriteLine("Time for a five minute break.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement