Guest User

Untitled

a guest
Jun 22nd, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main ()
  4. {
  5. char c;
  6. puts ("Enter q to exit:");
  7. do {
  8. c = getchar();
  9. putchar(c);
  10. } while (c != 'q');
  11. return 0;
  12. }
  13.  
  14. using System;
  15. using System.IO;
  16.  
  17. public static void Main(String[] args)
  18. {
  19. ConsoleKeyInfo k;
  20. Console.WriteLine("Enter q to exit:");
  21. do {
  22. k = Console.ReadKey();
  23. Console.WriteLine(k.KeyChar);
  24. } while (k.KeyChar != 'q');
  25. return 0;
  26. }
Add Comment
Please, Sign In to add comment