Answer to Question #332466 in C# for Claire

Question #332466

1. A one-dimensional array that contains six (6) names of your classmates. Then, print the names using a foreach loop.



2. A two-dimensional array with two (2) rows and three (3) columns. Then, initialize the array with the first six (6) letters of the alphabet as its elements.



3. A string with any message. Then, determine if the message contains the string, "hello".

1
Expert's answer
2022-04-23T09:04:47-0400
using System;
class Program {
  public static void Main (string[] args) {
        string []classmates=new string[6];
        Console.WriteLine("Please enter 6 names your classmate");
         for(int i=0;i<6;i++)
          {
            classmates[i]=Console.ReadLine();
           }
        Console.WriteLine("***********Out for foreach loop*******************");
        foreach(string itm in classmates)
        Console.WriteLine(itm);
        Console.ReadKey();
    }
  }

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS