After writing my second program in C#, I receive an error:
The error might pertain to the library or it might be on the Conversion or the namespace
using System;
namespace MagpantayUserInfoProg {
class UserInfo {
static void Main() {
string name, gender; // Variables for storing words
int contact, age; // Variables for storing integers
Console.Write("Name: "); // Let the user input his name
name = Console.ReadLine(); // System reads data
Console.Write("Gender: "); // Let the user input his gender
gender = Console.ReadLine();// System reads data
Console.Write("Age: "); // Let the user input his age
age = Int32.Parse(Console.ReadLine()); // System reads data
Console.Write("Mobile Number: "); // Let the user input his contact number
contact = Int32.Parse(Console.ReadLine()); // System reads data
// Display Output
Console.Write("Name: {0}\n", name);
Console.Write("Gender: {0}\n", gender);
Console.Write("Age: {0}\n", age);
Console.Write("Mobile Number: {0}\n", contact);
Console.ReadLine();
}
}
}
contactbecause it's too large for anInt32