+ 1

I'm going mad - cheer creator problem in c#

This works in all except the first case and I am at the end of knowing what I've done wrong! Any help appreciated please! namespace Sololearn { class Program { static void Main(string[] args) { int yards = Convert.ToInt32(Console.ReadLine()); { if (yards > 10) Console.WriteLine("High Five"); else if (yards < 1) Console.WriteLine("shh"); else for (yards=1;yards<=10;yards++) Console.WriteLine("Ra!", yards); } } } }

23rd Jun 2022, 1:16 PM
Eleanor Bushell
Eleanor Bushell - avatar
2 Antworten
+ 6
Eleanor Bushell , - please do not post a complete code here in the text area - save your code in playground and post only the link to it here - your code is not complete, all the <using ...> are missing - the logic in the for loop (in the else... clause) is not correct. the repetition of "Ra!" is always the same: 10 times.
23rd Jun 2022, 2:09 PM
Lothar
Lothar - avatar
+ 3
Read the description again for the case to output when input is between 1 to 10. Is not asked Output "Ra!" Inputs times!!!?
23rd Jun 2022, 2:16 PM
Jayakrishna 🇮🇳