Foreach Loop and Display the Number in C#



Foreach Loop and Display the Number in C#

using System.IO;  
using System;  
class foreachLoop  
{  
   private static void Main(string[] args)  
   {  
      int [] rollnumbers = new [] {100, 200, 300, 400};  
      foreach(int rollnumber in rollnumbers)  
      {  
         Console.WriteLine("Roll Number: {0}", rollnumber);  
      }  
   }    
} 

0 Comment's

Comment Form

Submit Comment