Sunday, July 22, 2007

Answer Exam 1 UIC SysProg



using System;
using System.Collections.Generic;
using System.Text;
namespace practice
{
class Program
{
static void Main(string[] args)
{
string[] num = new string[3];
float[] numf = new float[3];
float index = 0;
int j;
for (int x = 0; x <>
{
Console.Write("Enter float {0}: ", x + 1);
num[x] = Console.ReadLine();
numf[x] = float.Parse(num[x]);
}
Console.WriteLine("");
Console.WriteLine("Order:");
for (int i = 0; i <>
{
index = numf[i];
j = i;
while ((j > 0) && (numf[j - 1] > index))
{
numf[j] = numf[j - 1];
j = j - 1;

}
numf[j] = index;
}
for (int x = 0; x <>
{
Console.WriteLine(numf[x]);
}
Console.ReadLine();
}
}
}


No comments: