Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace StringUpper
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. string a;
  14. int i,L;
  15. char[] b;
  16. Console.WriteLine("Convert a string to uppercase");
  17. Console.WriteLine("\n");
  18. Console.WriteLine("Enter the String:");
  19. a = Console.ReadLine();
  20. L = a.Length;
  21. b = a.ToCharArray(0, L);
  22. for (i = 0; i < L; i++)
  23. {
  24. b[i] = (char)(b[i] - 32);
  25. Console.Write(b[i]);
  26. }
  27.  
  28. Console.ReadLine();
  29.  
  30. }
  31. }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement