Need help with C# question | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Need help with C# question

Ive been trying to learn the C# way of coding and came across a question in the module 5 quiz of this course that should ve the last question. It deals with: in the word "Sololearn"; x: finding the length, y: finding the index of "e" and then finding the modulus of x%y. The answer is 4 and i cant fugure out how.

9th Sep 2017, 10:43 PM
3 Answers
+ 2
length is an actual number of letters = 9; index of 'e' is 5, because indexation begins from "0". 9%5 = 4
9th Sep 2017, 11:09 PM
Топчий Анастасия Александровна
Топчий Анастасия Александровна - avatar
+ 2
Sololearn e is the 6th letter from the left so y=5 It has 9 letters so x=9 9%5=4
9th Sep 2017, 11:20 PM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar
25th Oct 2019, 1:51 AM