NedyalkoKikov

SumTwoArrays

Jun 4th, 2016
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 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 Testing
  8. {
  9. class Testing
  10. {
  11. static void Main()
  12. {
  13. int[] arr = new int[] { 10, 20, 30 };
  14. int[] arr2 = new int[] { 40, 50, 60 };
  15. List<int> res = new List<int>();
  16. for (int i = 0, j = 0; i < arr.Length;i++,j++)
  17. {
  18. res.Add(arr[i] + arr2[j]);
  19. }
  20. Console.WriteLine(string.Join(" ",res));
  21. }
  22. }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment