jueves, 27 de marzo de 2014

Ingresar 2 vectores y sumar

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace practica_1
{
    class Program
    {
        static void Main(string[] args)
        {
        Console.WriteLine("HOLA A TODOS");
        Console.BackgroundColor = ConsoleColor.Blue;
        Console.ForegroundColor = ConsoleColor.Green;
        Console.WriteLine("ESTA ES MI PRIMERA APLICACION EN C#");

            int c = 0;
            int[] vec1;
            vec1 = new int[10];
            int[] vec2;
            vec2 = new int[10];
            int[] vecs;
            vecs = new int[10];
             for (int j = 2; j <= 20; j+=2)
                {
                vec1[c] = j;
                Console.WriteLine(vec1[c]);
                c++;
              
               
            }
                Console.WriteLine();
                c = 0;
                for (int j = 1; j <= 20; j +=2)
                {
                vec2[c] = j;
                Console.WriteLine(vec2[c]);
                c++;
                }
                Console.WriteLine();
                c = 0;
            for (int j = 0; j <=10 ; j++)
            {
                vecs[c]=vec1[j]+vec2[j];
                Console.WriteLine(vecs[c]);
                c++;
            }
               
           

            Console.ReadLine();
  
       
        }
    }
}

No hay comentarios:

Publicar un comentario