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 Ex_7_ASPNET_04_Array
- {
- class Program
- {
- static void Main(string[] args)
- {
- //Declaracao de variaveis
- int[] iValores = new int[10];
- Random random = new Random();
- // Preenche array com numeros aleatórios
- for (int i = 0; i < iValores.Length; i++)
- {
- iValores[i] = random.Next(1, 26);
- Console.WriteLine("{0}", iValores[i]);
- }
- //Ignora o 1º elemento do iValores e dá saída dos dados
- int j = 0;
- Console.WriteLine("\nValores anteriores, sem o valor da 1º posição: ");
- for (int i = 0; i < iValores.Length; i++)
- {
- if (i != 0)
- {
- iValores[j] = iValores[i];
- j++;
- Console.WriteLine("{0}", iValores[j]);
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement