TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Srinivasan Jayaraman
NA
96
21.2k
FormateException Was UnHandled
Nov 15 2014 2:51 AM
i wrote a code in c# language as console application, i got error at GETTING INPUT IN ADDRESS AREA, see below mentioned comment,
public class bloodgroupdetails
{
int[] emp_code = new int[10];
string[] emp_name = new string[30];
int[] age = new int[5];
char[] address = new char[30];
char[] blood_grp = new char[10];
int[] salary = new int[10];
public int n, i;
public void getdata()
{
Console.WriteLine("\n how many employee details are going to be get:");
n = int.Parse(Console.ReadLine());
for (i = 0; i < n; i++)
{
Console.WriteLine("\nEnter the employee code:");
emp_code[i] = int.Parse(Console.ReadLine());
Console.WriteLine("\n enter the employee name:");
emp_name[i] = Console.ReadLine();
Console.WriteLine("\n enter the age:");
age[i] = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("\n enter the address:");
address[i] = Convert.ToChar(Console.ReadLine()); //// when i get input from user at runtime it show FORMATEEXCEPTION WAS UNHANDLED and i cannot go forward to get furture input.
Console.WriteLine("\n enter the blood group:");
blood_grp[i] = char.Parse(Console.ReadLine());
Console.WriteLine("\n enter the salary:");
salary[i] = int.Parse(Console.ReadLine());
}
Reply
Answers (
2
)
how to compress all files from different paths
get iso fields byte numbers in c#