c# code | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

c# code

int[] arr = {0, 5, 3, 2, 1 }; foreach (int item int arr) { Console.WriteLine(item); }

7th Feb 2018, 7:29 PM
Mesut Alcicek
Mesut Alcicek - avatar
3 Answers
+ 7
CHANGE: foreach (int item int arr) TO: foreach (int item in arr) Your problem is that you put INT instead of IN for the foreach function.
7th Feb 2018, 7:39 PM
Fata1 Err0r
Fata1 Err0r - avatar
+ 2
int[] arr = {0, 5, 3, 2, 1 }; foreach (int item in arr) { Console.WriteLine( item ); }
24th Apr 2021, 7:00 AM
Md. Rakibul Islam
Md. Rakibul Islam - avatar
0
you have to say: int[] arr = {0, 5, 3, 2, 1 }; foreach (int item in arr) { Console.WriteLine(item); }
7th Jul 2023, 3:41 PM
behrad baghi