Guest User

Untitled

a guest
Dec 17th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.32 KB | None | 0 0
  1. namespace ArraysandMethods
  2. {
  3. class Program
  4. {
  5. static void Main(string[] args)
  6. {
  7. {
  8. //Declarations
  9. int[] numberlist = new int[11];
  10. double[] doublelist = new double[11];
  11. Array.Copy(numberlist, doublelist, numberlist.Length);
  12. int length = numberlist.GetLength(0);
  13. const int end = 0;
  14. int count = 0;
  15.  
  16. Console.Write(" Enter 10 numbers to convert to double n PRESS 0 TO ENDn ");
  17. Console.Write("____________________________________________________________nn");
  18.  
  19. do
  20. {
  21.  
  22. //get user input
  23. for (int i = 1; i < numberlist.Length; i++)
  24. {
  25. Console.Write("| Enter next number: ");
  26. numberlist[i] = Convert.ToInt32(Console.ReadLine());
  27.  
  28.  
  29. }
  30.  
  31. Console.Write(" Results:n");
  32. Console.Write("n____________________________________________________________nn");
  33. //print array
  34. for (int i = 1; i < numberlist.Length; i++)
  35. {
  36. Console.WriteLine($"Number at index ({i}) = {numberlist[i]} ");
  37.  
  38. }
  39.  
  40. Console.ReadKey();
  41.  
  42.  
  43. } while (count != end);
  44. }
  45. }
  46.  
  47. }
  48. }
Add Comment
Please, Sign In to add comment