'FOR LOOPS' is very stressful | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

'FOR LOOPS' is very stressful

i had a bit of confusion with the for loop which took a few hours to think about. which I finally want to ask you guys. It's hard to explain, so I'll give you an example ; https://code.sololearn.com/cU2zve38sRD2/?ref=app because the discussion feature on sololearn can't reply , so thank you for answering my confusion.

13th Feb 2022, 6:57 PM
Zarediq Bat
Zarediq Bat - avatar
1 Answer
+ 3
You are writing: "in this case, I want to change only 0 to N" Use if/else structure, to do something when the condition is true, and do something else otherwise. for (int i=0; i<4; i++) { if (i==0) { Console.WriteLine("N"); } else { Console.WriteLine(i); }
13th Feb 2022, 7:08 PM
Tibor Santa
Tibor Santa - avatar