martes, 20 de octubre de 2009

PRACTICA 7.2

SEUDOCODIGO


inicio

Real n, i, suma = 0;
Print “numero par entero”
Read n
if (n <>

for i = 2 to n; estep 2.0 { suma = suma + i; }

Print “suma de los pares es”, suma); Fin


CONSOLA



visual

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 PRACTICA_7._2_WINDOWS
{
public partial class Form1 : Form
{
double n, i, suma;
public Form1()
{
n = i;
suma = 0;
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
n = double.Parse(textBox1.Text);
if (n < text =" (" i =" 2;" i =" i" suma =" suma" text =" (">





No hay comentarios:

Publicar un comentario