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
hang pham
NA
9
0
everybody to discover the error in this code
Jun 23 2008 10:51 PM
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class TeamStruct
{
struct Team
{
public String country;
public int matchesPlayed;
public int[] goals;
}
static void Main(string[] args)
{
Team DemoTeam;
int totalGoals = 0;
Console.WriteLine("Input information for the country that plays football: ");
Console.WriteLine("input country name: ");
DemoTeam.country = Console.ReadLine();
Console.WriteLine("input number of matches played : ");
DemoTeam.matchesPlayed = int.Parse(Console.ReadLine());// tai sao lai phai dung int.parse
DemoTeam.goals = new int[DemoTeam.matchesPlayed];
for (int i = 0; i < DemoTeam.matchesPlayed; i++)
{
Console.WriteLine("Input no of goals in match{0}", i + 1);
DemoTeam.goals[i] = int.Parse(Console.ReadLine());
totalGoals = totalGoals + DemoTeam.goals[i];
}
Console.WriteLine("total number of matches played by {0}are{1}", DemoTeam.country, DemoTeam.matchesPlayed);
Console.WriteLine("total number of goals scored by {0} are {i}", DemoTeam.country, totalGoals);
}
}
}
everybody to discover the error in this code! The last line in this code to have mistake.
Reply
Answers (
3
)
How to Read a wav file from a Xml file in C#
textbox