Ahmet Taha

Ahmet Taha

  • NA
  • 381
  • 20.6k

c# console prolem

Sep 12 2021 8:58 AM

hello guyz could anyone can help me?

this is my code

Console.Write("write your sentence:\t");
            string word = Console.ReadLine();

            Console.Write("how many long?:\t");
            int num = Convert.ToInt32(Console.ReadLine());

            string stor = [word];

            for (int x = 0; x < stor.Length; x++) ;
            {
                foreach (int x in stor)
                {
                    Console.WriteLine(x);
                }
            }

            Console.ReadKey();

 

 

and the ouput should be

write your sentence:    c sharp corner
how many long?: 2

c sharp corner

c sharp corner


Answers (2)