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;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ArrayOfIntegers
- {
- class ArrayOfIntegers
- {
- static void Main()
- {
- int[] arrayOfIntegers = new int[20];
- int multiplier = 5;
- for (int i = 0; i < arrayOfIntegers.Length; i++)
- {
- arrayOfIntegers[i] = i * multiplier;
- Console.WriteLine("{0,2}) {1} * {2} = {3}", i+1, i, multiplier, arrayOfIntegers[i]);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement