Click here to Skip to main content
15,900,258 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hello everybody,I have myself a question .
At university,Students tuition at time,Program will print this list of students.I have know how to print a student.But I don't know how to print many students at a time.
How to program work :confused:? Thanks everyone for helping me
Posted
Updated 6-Dec-10 18:53pm
v3
Comments
Sandeep Mewara 7-Dec-10 0:44am    
What have you tried so far?
Toli Cuturicu 7-Dec-10 7:15am    
No question.

1 solution

Hi
In C#:

using System.Windows.Forms;
list<string> students = new list<string>();


void main
{
  fillStudentList();
  PrintStudents();
}

void PrintStudents()
{
  foreach (string s in students)
  {
    MessageBox.Show(s);
  }
}

void fillStudentList()
{
  students.Add("John");
  students.Add("Jack");
  students.Add("Pete");
  students.Add("Mario");
}


Hope this was of help!
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900