Advertisement
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 BP_19_01_2023_1d_arrays
- {
- internal class Program
- {
- static void Main(string[] args)
- {
- int size = 5;
- int[] a = new int[size];
- int[] b = new int[size];
- int[] c = new int[size];
- Console.WriteLine("Array a:");
- for (int i = 0; i < size; i++)
- {
- Console.Write($"a[{i}]: ");
- a[i] = int.Parse( Console.ReadLine() );
- }
- Console.Clear();
- Console.WriteLine("Array b:");
- for (int i = 0; i < size; i++)
- {
- Console.Write($"b[{i}]: ");
- b[i] = int.Parse(Console.ReadLine());
- }
- Console.Clear();
- Console.WriteLine("a[i]\t+\tb[i]\t=\tc[i]:");
- for (int i = 0; i < size; i++)
- {
- c[i] = a[i] + b[i];
- Console.WriteLine($"{a[i]}\t+\t{b[i]}\t=\t{c[i]}");
- }
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement