Ok, I want to first start off by saying I'm not a student so this question has nothing to do with homework at all. I'm trying to learn C# because the company that I want to work for uses it. I heard that C# is very similar to java so I'm using my java book that has exercise problems to practice c#. Here is my question, I'm trying to make a simple program that the user enters 3 grades and it stores it in an array and then displays the three grades that were entered. The problem is that its not storing the grades. It does however display some random number like if I put in 34, 44, and 54 it returns 51. Here is my code and thanks everyone:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Practice1
{
class Program
{
static void Main(string[] args)
{
int[] test = new int[4];
int i = 1;
for (i = 1; i <= 3; i++)
{
Console.WriteLine("Please enter test " + i);
test[i] = Console.Read();
Console.ReadLine();
}
for (i = 1; i <=3; i++)
{
Console.WriteLine(test[i]);
Console.ReadLine();
}
}
}
}
for(int i = 0; i < test.Length; ++i) { }