Ejercicio 1 window form
namespace appHEjercicio1
{
partial class Form1
{
/// <summary>
/// Variable del diseñador requerida.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Limpiar los recursos que se estén utilizando.
/// </summary>
/// <param name="disposing">true si los recursos administrados se deben eliminar; false en caso contrario, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Código generado por el Diseñador de Windows Forms
/// <summary>
/// Método necesario para admitir el Diseñador. No se puede modificar
/// el contenido del método con el editor de código.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
this.lblvelocidad = new System.Windows.Forms.Label();
this.lbltiempo = new System.Windows.Forms.Label();
this.lblespacio = new System.Windows.Forms.Label();
this.txtvelocidad = new System.Windows.Forms.TextBox();
this.txttiempo = new System.Windows.Forms.TextBox();
this.txtespacio = new System.Windows.Forms.TextBox();
this.btncalcular = new System.Windows.Forms.Button();
this.btnsalir = new System.Windows.Forms.Button();
this.button1 = new System.Windows.Forms.Button();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.SuspendLayout();
//
// lblvelocidad
//
this.lblvelocidad.AutoSize = true;
this.lblvelocidad.Location = new System.Drawing.Point(40, 50);
this.lblvelocidad.Name = "lblvelocidad";
this.lblvelocidad.Size = new System.Drawing.Size(54, 13);
this.lblvelocidad.TabIndex = 0;
this.lblvelocidad.Text = "Velocidad";
//
// lbltiempo
//
this.lbltiempo.AutoSize = true;
this.lbltiempo.Location = new System.Drawing.Point(40, 89);
this.lbltiempo.Name = "lbltiempo";
this.lbltiempo.Size = new System.Drawing.Size(42, 13);
this.lbltiempo.TabIndex = 1;
this.lbltiempo.Text = "Tiempo";
//
// lblespacio
//
this.lblespacio.AutoSize = true;
this.lblespacio.Location = new System.Drawing.Point(40, 130);
this.lblespacio.Name = "lblespacio";
this.lblespacio.Size = new System.Drawing.Size(45, 13);
this.lblespacio.TabIndex = 2;
this.lblespacio.Text = "Espacio";
//
// txtvelocidad
//
this.txtvelocidad.Location = new System.Drawing.Point(121, 42);
this.txtvelocidad.Name = "txtvelocidad";
this.txtvelocidad.Size = new System.Drawing.Size(100, 20);
this.txtvelocidad.TabIndex = 3;
//
// txttiempo
//
this.txttiempo.Location = new System.Drawing.Point(121, 82);
this.txttiempo.Name = "txttiempo";
this.txttiempo.Size = new System.Drawing.Size(100, 20);
this.txttiempo.TabIndex = 4;
//
// txtespacio
//
this.txtespacio.Location = new System.Drawing.Point(121, 123);
this.txtespacio.Name = "txtespacio";
this.txtespacio.Size = new System.Drawing.Size(100, 20);
this.txtespacio.TabIndex = 5;
//
// btncalcular
//
this.btncalcular.Location = new System.Drawing.Point(43, 182);
this.btncalcular.Name = "btncalcular";
this.btncalcular.Size = new System.Drawing.Size(75, 23);
this.btncalcular.TabIndex = 6;
this.btncalcular.Text = "Calcular";
this.btncalcular.UseVisualStyleBackColor = true;
this.btncalcular.Click += new System.EventHandler(this.btncalcular_Click);
//
// btnsalir
//
this.btnsalir.Location = new System.Drawing.Point(174, 181);
this.btnsalir.Name = "btnsalir";
this.btnsalir.Size = new System.Drawing.Size(75, 23);
this.btnsalir.TabIndex = 7;
this.btnsalir.Text = "Salir";
this.btnsalir.UseVisualStyleBackColor = true;
this.btnsalir.Click += new System.EventHandler(this.btnsalir_Click);
//
// button1
//
this.button1.Location = new System.Drawing.Point(112, 227);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(75, 23);
this.button1.TabIndex = 8;
this.button1.Text = "Nuevo";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// pictureBox1
//
this.pictureBox1.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("pictureBox1.BackgroundImage")));
this.pictureBox1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.pictureBox1.Location = new System.Drawing.Point(318, 42);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(100, 94);
this.pictureBox1.TabIndex = 9;
this.pictureBox1.TabStop = false;
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("$this.BackgroundImage")));
this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.ClientSize = new System.Drawing.Size(455, 496);
this.Controls.Add(this.pictureBox1);
this.Controls.Add(this.button1);
this.Controls.Add(this.btnsalir);
this.Controls.Add(this.btncalcular);
this.Controls.Add(this.txtespacio);
this.Controls.Add(this.txttiempo);
this.Controls.Add(this.txtvelocidad);
this.Controls.Add(this.lblespacio);
this.Controls.Add(this.lbltiempo);
this.Controls.Add(this.lblvelocidad);
this.Name = "Form1";
this.Text = "Ejercicio 1";
this.Load += new System.EventHandler(this.Form1_Load);
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label lblvelocidad;
private System.Windows.Forms.Label lbltiempo;
private System.Windows.Forms.Label lblespacio;
private System.Windows.Forms.TextBox txtvelocidad;
private System.Windows.Forms.TextBox txttiempo;
private System.Windows.Forms.TextBox txtespacio;
private System.Windows.Forms.Button btncalcular;
private System.Windows.Forms.Button btnsalir;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.PictureBox pictureBox1;
}
}
ejercicio 1 en Windows form
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace appejercicio_1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button2_Click(object sender, EventArgs e)
{
int t, v, E;
t = int.Parse(textBox1.Text);
v = int.Parse(textBox2.Text);
E = v * t;
textBox3.Text = (E.ToString());
}
private void button1_Click(object sender, EventArgs e)
{
textBox1.Clear();
textBox2.Clear();
textBox3.Clear();
textBox1.Focus();
}
private void button3_Click(object sender, EventArgs e)
{
Close();
}
}
}
Ejercicio 2 en consola
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace appEjercico02
{
class Program
{
static void Main(string[] args)
{
//declarar variables
int Vl, Vt, T;
int espacioliebretortuga;
//leer datos
Console.WriteLine("Ingrese la velocidad de la Liebre");
Vl = int.Parse(Console.ReadLine());
Console.WriteLine("Ingrese la velocidad de la Tortuga");
Vt = int.Parse(Console.ReadLine());
Console.WriteLine("Ingrese el Tiempo");
T = int.Parse(Console.ReadLine());
//Procesos
espacioliebretortuga = T*(Vl - Vt);
//Resultado
Console.WriteLine("El espacio entre la liebre y la tortuga es:");
Console.WriteLine(espacioliebretortuga);
Console.ReadKey();
}
}
}
Ejercicio 2 en Windows form
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace appEjercicio2
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void btnCalcular_Click(object sender, EventArgs e)
{
//declarar variables
int vt, vl, t;
int espacioliebretotuga;
//datos
vl = int.Parse(txtvl.Text);
vt = int.Parse(txtvt.Text);
t = int.Parse(txtt.Text);
//procesos
espacioliebretotuga = (vl - vt)*t;
//resultado
txtespacio.Text = (espacioliebretotuga.ToString());
}
private void btnnuevo_Click(object sender, EventArgs e)
{
txtvl.Clear();
txtvt.Clear();
txtt.Clear();
txtespacio.Clear();
}
private void btnsalir_Click(object sender, EventArgs e)
{
Close();
}
}
}
Ejercicio 06 en console
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace appEjercicio06
{
class Program
{
static void Main(string[] args)
{
//Declarar Variables
int numeros;
//Declarar Resultados
int unidades;
int decenas;
//Leer Datos
Console.WriteLine("ingrese numero");
numeros = int.Parse(Console.ReadLine());
//Procesos
unidades = numeros % 10;
decenas = numeros / 10;
//Escribir el resultado
Console.WriteLine("las unidades son:");
Console.WriteLine(unidades);
Console.WriteLine("las decenas son:");
Console.WriteLine(decenas);
Console.ReadKey();
}
}
}
Eejrcicio del examen en console
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace appHEjercicio27
{
class Program
{
static void Main(string[] args)
{
//declarar variables
double E ;
int x, y;
//leer datos
Console . WriteLine("ingrese el valor de x");
x = int . Parse(Console.ReadLine());
Console . WriteLine("ingrese el valor de la y");
y = int . Parse(Console. ReadLine() );
//procesos
E = 10 * x * y + 4 * x / y;
//escribir resultado
Console.WriteLine(E);
}
}
}
Ejercicio 09 en consolé
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace appEjercicio9
{
class Program
{
static void Main(string[] args)
{
//declarar variables
int mm, ss, hf, mf, sf,ts,hh;
//leer datos
Console.WriteLine("la hora inicial es");
hh = int.Parse(Console.ReadLine());
Console.WriteLine("el minuto inicial es");
mm = int.Parse(Console.ReadLine());
Console.WriteLine("el segundo inicial es");
ss = int.Parse(Console.ReadLine());
//procesos
ts=(hh*3600)+(mm*60)+ss+1;
hf=ts/3600;
mf=(ts%3600)/60;
sf=(ts%360)%60;
//resultado
Console.WriteLine("la hora final es");
Console.WriteLine(hf);
Console.WriteLine("el minuto final es");
Console.WriteLine(mf);
Console.WriteLine("el segundo final es");
Console.WriteLine(sf);
Console.ReadKey();
}
}
}
Ejercicio 12 En consolé
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace appEjercicio012
{
class Program
{
static void Main(string[] args)
{
//ingresar variables
int soles;
double dolares;
//leer datos
Console.WriteLine("Ingresar Monto en Soles");
soles = int.Parse(Console.ReadLine());
//Procesoss
dolares = soles / 2.67;
//escribir resulatados
Console.WriteLine("El Monto en Dolares es");
Console.WriteLine(dolares);
Console.ReadKey();
}
}
}
Ejercicio 11 en consolé
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace appEjercicio011
{
class Program
{
static void Main(string[] args)
{
//declarar variables
int N;
int cuadrado, cubo;
double mitad;
//datos
Console.WriteLine("Ingrese cualquien numero:");
N = int.Parse(Console.ReadLine());
//procesos
mitad = N / 2;
cuadrado = N * N;
cubo = N *N*N;
//Resultado
Console.WriteLine("La mitad es:");
Console.WriteLine(mitad);
Console.WriteLine("El cuadrado es:");
Console.WriteLine(cuadrado);
Console.WriteLine("El cubo es:");
Console.WriteLine(cubo);
Console.ReadKey();
}
}
}
Ejercicio 10 en consolé
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace appEjercicio010
{
class Program
{
static void Main(string[] args)
{
//declarar variables
int N;
int cuadrado;
//leer datos
Console.WriteLine("Ingrese cualquien numero:");
N = int.Parse(Console.ReadLine());
//proceso
cuadrado = N * N;
//resultado
Console.WriteLine("el cuadrado del numero es:");
Console.WriteLine(cuadrado);
Console.ReadKey();
}
}
}
Ejercicio 09 en consolé
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace appEjercicio9
{
class Program
{
static void Main(string[] args)
{
//declarar variables
int mm, ss, hf, mf, sf,ts,hh;
//leer datos
Console.WriteLine("la hora inicial es");
hh = int.Parse(Console.ReadLine());
Console.WriteLine("el minuto inicial es");
mm = int.Parse(Console.ReadLine());
Console.WriteLine("el segundo inicial es");
ss = int.Parse(Console.ReadLine());
//procesos
ts=(hh*3600)+(mm*60)+ss+1;
hf=ts/3600;
mf=(ts%3600)/60;
sf=(ts%360)%60;
//resultado
Console.WriteLine("la hora final es");
Console.WriteLine(hf);
Console.WriteLine("el minuto final es");
Console.WriteLine(mf);
Console.WriteLine("el segundo final es");
Console.WriteLine(sf);
Console.ReadKey();
}
}
Ejrcicio 02 en console
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication4
{
class Program
{
static void Main(string[] args)
{// declarar variables
int vl, vt, t;
int espacioliebretortuga;
// leer datos
Console.WriteLine("ingrese velocidad");
vl = int.Parse(Console.ReadLine());
Console.WriteLine("ingreseVelocidad detortuga");
vt = int.Parse(Console.ReadLine());
Console.WriteLine("ingresar velocidad de tiempo");
t = int.Parse(Console.ReadLine());
// proceso
espacioliebretortuga = t *(vl-vt);
//resultado
Console.WriteLine("ingreseEspacioLiebreTortuga");
Console.WriteLine(espacioliebretortuga);
Console.ReadKey();
}
}
}
Ejercio 06 en console
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace appEjercicio06
{
class Program
{
static void Main(string[] args)
{
//Declarar Variables
int numeros;
//Declarar Resultados
int unidades;
int decenas;
//Leer Datos
Console.WriteLine("ingrese numero");
numeros = int.Parse(Console.ReadLine());
//Procesos
unidades = numeros % 10;
decenas = numeros / 10;
//Escribir el resultado
Console.WriteLine("las unidades son:");
Console.WriteLine(unidades);
Console.WriteLine("las decenas son:");
Console.WriteLine(decenas);
Console.ReadKey();
}
}
}
Ejercicio 07 en windons form
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace appHEjercicio6
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void textdecenas_TextChanged(object sender, EventArgs e)
{
}
private void btnprocesar_Click(object sender, EventArgs e)
{
//declarar variables
int numero, unidades, decenas;
//leer datos
numero = int.Parse(textnumero.Text);
//procesar
unidades = numero % 10;
decenas = numero / 10;
//resltado
textBox2.Text = (unidades.ToString());
textdecenas.Text = (decenas.ToString());
}
}
}
Ejercicio 07 en console
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace appejercicio7
{
class Program
{
static void Main(string[] args)
{ // declarar varibles
int numero;
// declarar resultado
int unidades;
int decenas;
int centenas;
// declarar variables auxiliares
// leer datos
numero = int.Parse(Console.ReadLine());
// proceso
unidades=numero%10;
decenas=numero/10;
centenas=numero/100;
// escribir resultado
Console.WriteLine(unidades);
Console.WriteLine(decenas);
Console.WriteLine(centenas);
Console.ReadKey();
}
}
}
Ejercicio en console
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace appEjercicio9
{
class Program
{
static void Main(string[] args)
{
//declarar variables
int mm, ss, hf, mf, sf,ts,hh;
//leer datos
Console.WriteLine("la hora inicial es");
hh = int.Parse(Console.ReadLine());
Console.WriteLine("el minuto inicial es");
mm = int.Parse(Console.ReadLine());
Console.WriteLine("el segundo inicial es");
ss = int.Parse(Console.ReadLine());
//procesos
ts=(hh*3600)+(mm*60)+ss+1;
hf=ts/3600;
mf=(ts%3600)/60;
sf=(ts%360)%60;
//resultado
Console.WriteLine("la hora final es");
Console.WriteLine(hf);
Console.WriteLine("el minuto final es");
Console.WriteLine(mf);
Console.WriteLine("el segundo final es");
Console.WriteLine(sf);
Console.ReadKey();
}
}
}
Ejercicio en windons form
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace appEjercicio1._9
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void btnprocesar_Click(object sender, EventArgs e)
{
//declara variables
int hh, mm, ss, hf, mf, sf,ts;
//leer datos
hh = int.Parse(texthorainicial.Text);
mm = int.Parse(textminutoinicial.Text);
ss = int.Parse(textsegundoinicial.Text);
//procesar
ts = (hh * 3600) + (mm * 60) + ss + 1;
hf = ts / 3600;
mf = (ts % 3600) / 60;
sf = (ts % 360) % 60;
//resultado
texthorafinal.Text = (hf.ToString());
textminutofinal.Text = (mf.ToString());
textsegundofinal.Text = (sf.ToString());
}
}
}
Ejercicio 1 del examen en Windows form
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace appHPregunta1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void btnProcesar_Click(object sender, EventArgs e)
{
//declar variables
int x, y;
double E;
//leer datos
x = int.Parse(txtx.Text);
y = int.Parse(txty.Text);
//procesos
E = ((10 * x * y) + (4 * y)) / y;
//resultado
txte.Text = (E.ToString());
}
private void btnSalir_Click(object sender, EventArgs e)
{
Close();
}
private void btnNuevo_Click(object sender, EventArgs e)
{
txtx.Clear();
txty.Clear();
txte.Clear();
txtx.Focus();
}
}
}
Ejercicio 02 del examen en console
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication7
{
class Program
{
static void Main(string[] args)
{
//declar variables
int montoensoles;
double pagodepollo, pagodepapa, loquemequeda;
//leer Datos
Console.WriteLine("el omnto en soles es:")
montoensoles=int.Parse(Console.ReadLine());
//procesos
pagodepollo=montoensoles/2;
pagodepapa=pagodepollo*0.3;
loquemequeda=pagodepapa*0.7;
//resultado
Console.WriteLine("el pago de pollo es:");
Console.WriteLine(pagodepollo);
Console.WriteLine("el pago de la papa es");
Console.WriteLine(pagodepapa);
Console.WriteLine("lo que me queda es");
Console.WriteLine(loquemequeda);
Console.ReadKey();
}
}
}
Ejercicio 2 del examen en Windows form
namespace appHPreguntadeExamen2
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
//declar variables
int montoensoles;
double pagodepollo, pagodepapa, loquemequeda;
//leer datos
montoensoles=int.Parse(textBox1.Text);
//procesos
pagodepollo = montoensoles / 2;
pagodepapa = pagodepollo * 0.3;
loquemequeda = pagodepollo * 0.7;
//resultado
textBox2.Text = (pagodepollo.ToString());
textBox3.Text = (pagodepapa.ToString());
textBox4.Text = (loquemequeda.ToString());
}
private void button2_Click(object sender, EventArgs e)
{
//nuevo
textBox1.Clear();
textBox2.Clear();
textBox3.Clear();
textBox4.Clear();
textBox1.Focus();
}
private void button3_Click(object sender, EventArgs e)
{
Close();
}
}
}
Ejercicio 2 del examen en console
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace appPreguntadeExamen01
{
class Program
{
static void Main(string[] args)
{
//declarar variables
int x, y;
double e;
//leer datos
Console.WriteLine("la Variable x es:");
x=int.Parse(Console.ReadLine());
Console.WriteLine("la variable y es:");
y = int.Parse(Console.ReadLine());
//Procesos
e = ((10 * x * y) + 4 * x) / y;
//resultado
Console.WriteLine("el valor de E=");
Console.WriteLine(e);
Console.ReadKey();
}
}
}
Ejercio en Windows form
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsEjercicio_2
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button4_Click(object sender, EventArgs e)
{
}
private void button2_Click(object sender, EventArgs e)
{
}
private void Form1_Load(object sender, EventArgs e)
{
}
}
}
Ejercicio 9 en Windows form
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace appEjercicio1._9
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void btnprocesar_Click(object sender, EventArgs e)
{
//declara variables
int hh, mm, ss, hf, mf, sf,ts;
//leer datos
hh = int.Parse(texthorainicial.Text);
mm = int.Parse(textminutoinicial.Text);
ss = int.Parse(textsegundoinicial.Text);
//procesar
ts = (hh * 3600) + (mm * 60) + ss + 1;
hf = ts / 3600;
mf = (ts % 3600) / 60;
sf = (ts % 360) % 60;
//resultado
texthorafinal.Text = (hf.ToString());
textminutofinal.Text = (mf.ToString());
textsegundofinal.Text = (sf.ToString());
}
Ejercicio del examen en consola
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace appPreguntadeExamen01
{
class Program
{
static void Main(string[] args)
{
//declarar variables
int x, y;
double e;
//leer datos
Console.WriteLine("la Variable x es:");
x=int.Parse(Console.ReadLine());
Console.WriteLine("la variable y es:");
y = int.Parse(Console.ReadLine());
//Procesos
e = ((10 * x * y) + 4 * x) / y;
//resultado
Console.WriteLine("el valor de E=");
Console.WriteLine(e);
Console.ReadKey();
}
}
}
Ejercicio 3en console
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace appEjercicio03
{
class Program
{
static void Main(string[] args)
{
//<<<<<<<<<<<<<<<<<declarar variables>>>>>>>>>>>
//declarar datos
int N;
//declarar resultados
int Resultado;
//leer datos
Console.WriteLine("Ingrese cualquien numero Entero:");
N = int.Parse(Console.ReadLine());
//procesos
Resultado = (N*(N + 1) / 2);
//Resultado
Console.WriteLine("La suma de los n-numeros es:");
Console.WriteLine(Resultado);
Console.ReadKey();
}
}
}