0% found this document useful (0 votes)
29 views4 pages

Problema 02: Namespace Class Static Void String

The document contains 6 coding problems that involve taking user input, performing calculations, and outputting results. Each problem demonstrates a different programming concept: Problem 1 divides two numbers and outputs the quotient and remainder. Problem 2 calculates sales tax (IGV) and total price based on a purchase value. Problem 3 calculates exponentiation of two numbers. Problem 4 finds the nth root of a number. Problem 5 reverses the digits of a number. Problem 6 demonstrates various programming concepts.
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)
29 views4 pages

Problema 02: Namespace Class Static Void String

The document contains 6 coding problems that involve taking user input, performing calculations, and outputting results. Each problem demonstrates a different programming concept: Problem 1 divides two numbers and outputs the quotient and remainder. Problem 2 calculates sales tax (IGV) and total price based on a purchase value. Problem 3 calculates exponentiation of two numbers. Problem 4 finds the nth root of a number. Problem 5 reverses the digits of a number. Problem 6 demonstrates various programming concepts.
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/ 4

Problema 02

namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
//variables
float n1, n2, c, r;

//entrada
Console.Write("numero 1: ");
n1 = int.Parse(Console.ReadLine());
Console.Write("numero 2: ");
n2 = int.Parse(Console.ReadLine());

//proceso
c = n1 / n2;
r = n1 % n2;

//salida
Console.WriteLine("");
Console.WriteLine("cosiente: " + c);
Console.WriteLine("residuo: " + r);
Console.ReadLine();

}
}
}



Problema 03
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
//variables
float vv, igv, pv;

//entrada
Console.Write("valor de venta: ");
vv = float.Parse(Console.ReadLine());

//proceso
igv = vv * 0.19f;
pv = vv + igv;

//salida
Console.WriteLine("");
Console.WriteLine("igv. " + igv);
Console.WriteLine("precio de venta: " + pv);
Console.ReadLine();

}
}
}


Problema 04
namespace ConsoleApplication2
{
class Program
{
static void Main(string[] args)
{
//variable
short a, n;
int p;

//entrada
Console.Write("a: ");
a = short.Parse(Console.ReadLine());
Console.Write("n: ");
n = short.Parse(Console.ReadLine());

//proceso
p = (int)Math.Pow((double)a, (double)n);

//salida
Console.WriteLine("");
Console.WriteLine("potencia: " + p);
Console.ReadLine();


}
}
}



Problema 05
namespace ConsoleApplication3
{
class Program
{
static void Main(string[] args)
{
//variables
int a;
short n, r;

//entrada
Console.Write("a: ");
a = int.Parse(Console.ReadLine());
Console.Write("n: ");
n = short.Parse(Console.ReadLine());

//proceso
r = (short)Math.Pow((double)a, (1 / (double)n));

//salida
Console.WriteLine("");
Console.WriteLine("radicacion: " + r);
Console.ReadLine();

}
}
}

Problema 06
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
//variables
int n, ni, r;

//entrada
Console.Write("numero: ");
n = int.Parse(Console.ReadLine());

//prceso
r = n % 10;
n = n / 10;
ni = r * 10;

r = n % 10;
n = n / 10;
ni = (ni + r) * 10;

r = n % 10;
n = n / 10;
ni = (ni + r) * 10;

r = n % 10;
n = n / 10;
ni = (ni + r) * 10;

ni = ni + n;

//salida
Console.WriteLine("");
Console.WriteLine("inverso: " + ni);
Console.ReadLine();



}
}
}

You might also like