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 Arrays02
- {
- class Program
- {
- static void Main(string[] args)
- {
- string[] arrayProductosMarket;
- int cantProdMarket;
- Console.WriteLine("Digite la cantidad de productos del SuperMercado");
- _ = int.TryParse(Console.ReadLine(), out cantProdMarket);
- arrayProductosMarket = new string[cantProdMarket];
- // Ciclo para llenar datos del array
- for (byte i=0; i < arrayProductosMarket.Length; i++)
- {
- Console.WriteLine("Digite el nombre del producto {0}",(i+1));
- arrayProductosMarket[i] = Console.ReadLine();
- }
- // Ciclo para Visualizar elementos del array
- Console.WriteLine("--------------------------------");
- Console.WriteLine("Los productos disponibles del SuperMercado son:");
- for (byte i=0; i < arrayProductosMarket.Length; i++)
- {
- Console.WriteLine("Producto {0}: {1}",(i+1),arrayProductosMarket[i]);
- }
- Console.ReadKey();
- /* Ciclo para recorrer array e indicar si un elemento existe
- en el inventario del SuperMercado */
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement