Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace _02.Sum_of_2_arrays
- {
- class Program
- {
- static void Main(string[] args)
- {
- Console.WriteLine("Write end point: ");
- int end = int.Parse(Console.ReadLine());
- double[] first = new double[end];
- double[] second = new double[end];
- double sum = 0;
- for (int i = 0; i < end; i++)
- {
- first[i] = i + 1;
- second[i] = i + 1;
- }
- for (int i = 0; i < end; i++)
- {
- sum += Math.Pow(first[i], 2) + Math.Pow(second[i], 2);
- }
- Console.WriteLine(sum);;
- }
- }
- }
Add Comment
Please, Sign In to add comment