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 Arr
- {
- class ElemtsInArr
- {
- static void Main()
- {
- int[] simpleArray = { 1, 2, 3, 4, 5, 6 };
- int[] elementsByTwo = { 1, 2, 3, 4, 5, 6, 7 };
- ElementsInArray(simpleArray);
- Console.WriteLine();
- ElementsInArrayIncrementedByTwo(elementsByTwo);
- }
- public static int[] ElementsInArray(int[] simpleArray)
- {
- for (int i = 0; i < simpleArray.Length; i++)
- {
- int elements = simpleArray[i] + 1;
- Console.Write(elements + ", ");
- }
- return simpleArray;
- }
- public static int[] ElementsInArrayIncrementedByTwo(int[] elementsByTwo)
- {
- for (int i = 0; i < elementsByTwo.Length; i++)
- {
- int elements = elementsByTwo[i] * 2;
- Console.Write(elements + ", ");
- }
- return elementsByTwo;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement