What Would Be The Output For This In C# Language?
What would be the output? Could you explain to me why foreach loop is used here? It says that it will print all elements in an array? This code is displaying zeroes as output. Foreach (int Y In Arr) Console.WriteLine(y);
1 Answer - Sort by: Date | Rating
using System;
using System.Collections.Generic
using System.Text
class ForEachTest
{
  static void Main(string[] args)
  {
    int[] Arr = new int[] { 0, 1, 2, 3, 5, 8, 13 };
    foreach (int Y in Arr)
    {
      System.Console.WriteLine(Y);
    }
  }
}
// This code will print out the contents of ARR
1
0
- How Statistics Is Applied In Industrial Technology?
- Discuss Some Of The Issues And Consequences Of Integrating New Systems (web 2.0) Into Existing And Legacy Systems?
- Is There Any Site From Where I Can Learn VB?
- What Are The Disadvantages Of A Assembler?
- What Is The Ftps?
- When Is At&t U-verse Getting Funimation?
- What Are Form Factors?
- What R The Importance Of It Act?
- How Ethics Determine The Development Of Technology?
- 3. What Is The Difference Between Technical Support And Technical Development?
- Explain The Importance Of IT ACT 2000?
- What Is Pass Structure Of An Assembler?
- What Is Double Pass Assembler?
- What Is Fdma?how Is It Useful In Communication?
- How Can Marks Of 50 Students Be Put In Classes Of 10?
- Give The Salient Features Of SQL?
- What Are Modern Developments Of Science?
- What Is Difference Between Multithreading And Mutiprocessing?
- What Are The Limitations Of Filebase System?
- What Are Guidelines For Technical Support?
- What Are The Features Of Aix Assembler?
- Can You Explain The Difference Between Mis And Dss?
- What Is Cost Of Information?
- How Do I Get A Friend I Can Discuss Ict Issues With?
- How Can You Design 1 To 8 Demultiplexer Using 1 To 4 Demultiplexer?
- Which Output Statement Is Used In C++ Language?
- In C Language:- Int A=4,b=7; Printf("%d%d",b++,--b); What Is The Output ?why?
- What Is The Output?
- What Is Output?
- How Can You Get Output Without Using Controls?
- Could You Tell Me The Output Of This C#program?
- What Is Output Gap?
- What Are Output Devices?
- What Is An Output Device?

New Comment - Comments are editable for 5 min.