0

how this code functioning? why the answer is 120?

static void Main(string[] args) { int foo = 1; for (int x=5;x<=50;x++) { foo*=x; for(int y=1;y<=5;y++) { if(x==y) goto bar; foo*=y; } } bar:Console.Write(foo); }

21st May 2020, 5:23 AM
Irezer
Irezer - avatar
2 Answers
+ 2
~ swim ~ oh my! so it's just looping on 2nd loop only. I thought 2nd loop failed and back to 1st loop. X3 Thanks for the explanation. Really helpful here 👍👍
21st May 2020, 5:54 AM
Irezer
Irezer - avatar