0% found this document useful (0 votes)
11 views1 page

Namespace ConsoleApplication2

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views1 page

Namespace ConsoleApplication2

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

namespace ConsoleApplication2

{
    class Program
    {
static void Main(string [] args)
        {
            int na = 0;//Nunmero de articulos
            int a = 0;//Articulos
            int t = 0;//Total
            int s = 0;
            Console .WriteLine("\tTienda Johnson" );
            Console .WriteLine("\n\tPrograma para calcular el precio
total a pagar de un comprador" );
            Console .WriteLine("\nNumero de articulos a comprar" );
            na = int .Parse(Console .ReadLine());
        REPETIR:
               if (t++ < na)
            {
                Console .WriteLine("\nintroducir precio de cada
articulo" );
                a = int .Parse(Console .ReadLine());
                s = s + a;
                goto REPETIR;
}
            Console .WriteLine("la suma total es {0}" , s);
            Console .Read();
}
 }
}

You might also like