can we use "for each" loop in other programming languages also? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

can we use "for each" loop in other programming languages also?

21st Jun 2016, 10:49 AM
akshu jain
akshu jain - avatar
2 Answers
+ 2
Yes,we can use for each in other languages too like C#.Here is an example.... C# program that uses foreach over array using System; class Program { static void Main() { string[] pets = { "dog", "cat", "bird" }; // ... Loop with the foreach keyword. foreach (string value in pets) { Console.WriteLine(value); } } } Output dog cat bird
21st Jun 2016, 11:52 AM
BK MEN IS BACK
BK MEN IS BACK - avatar
0
yes we use in Android, Java and C#.net
18th Jul 2016, 5:56 AM
Amit
Amit - avatar