Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Write a program that allocates array of 20 integers and initializes each element by its index multiplied by 5. Print the obtained array on the console.
- using System;
- class MultipliedIndex
- {
- static void Main()
- {
- int[] array = new int[20];
- for (int i = 0; i < array.Length; i++)
- {
- array[i] = i * 5;
- }
- Console.WriteLine(string.Join(", ", array));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement