Nothing Special   »   [go: up one dir, main page]

Programacion I Semana VIII UAPA

Descargar como docx, pdf o txt
Descargar como docx, pdf o txt
Está en la página 1de 5

Nombre:

Christian Raimundo Medrano Mercedes


Matricula:
2019-06321
Materia
Programación I
Realiza un programa en Lenguaje C, que registre 10 notas en un vector y luego lo muestre
por pantalla.

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

namespace programacionsemanaIII
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("------------------------------------Christian
Medrano-----------------------------------------------");
double[] notas = new double[10];
for(int c = 0; c<10; c++){
Console.Write("Ingrese La nota #" + (c + 1) + ": ");
notas[c] = Convert.ToDouble(Console.ReadLine());

Console.WriteLine("Notas Insertadas");
for (int c = 0; c < 10; c++)
{
Console.WriteLine("Nota #" + (c + 1) + ": " + notas[c]);

}
Console.ReadKey();

}
}
}
Realiza un programa en Lenguaje C que ordene el vector anterior, de forma ascendente.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace programacionsemanaIII
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("------------------------------------Christian
Medrano-----------------------------------------------");
double[] notas = new double[10];
for(int c = 0; c<10; c++){
Console.Write("Ingrese La nota #" + (c + 1) + ": ");
notas[c] = Convert.ToDouble(Console.ReadLine());

Console.WriteLine("Notas Insertadas");
for (int c = 0; c < 10; c++)
{
Console.WriteLine("Nota #" + (c + 1) + ": " + notas[c]);

Array.Sort(notas);

Console.WriteLine("Notas Ordenadas");
for (int c = 0; c < 10; c++ )
{
Console.WriteLine("Nota #" + (c + 1) + ": " + notas[c]);
}
Console.ReadKey();

}
}
}

También podría gustarte