Ahmet Taha

Ahmet Taha

  • 1.7k
  • 368
  • 7.4k

c# console problem 103

Sep 20 2021 1:50 PM

Hello Guz, i need help how i would output like this?;

enter number of member: (e.g: 4)

member 1: rafael

member2: ahmad

member3: Juan

member 4: Kim

The member are : RAFAEL , AHMAD, JUAN, KIM

They are : 4 member.

here is my code :

int x, y;
Console.Write("enter number of member:\t");
int num = Convert.ToInt32(Console.ReadLine());
string[] haba = new string[num];
for (x = 0; x <= num; x++)
{
    Console.Write("member{0}", num);
    haba[x] = Console.ReadLine();
}
Console.Write("The member are:\t{0}", haba[x]);
//foreach(string z in haba)
//{
//    Console.Write(z);
//}
Console.ReadKey();

Answers (1)